diff --git a/codegen/method.go b/codegen/method.go index f609a28c1..11e917056 100644 --- a/codegen/method.go +++ b/codegen/method.go @@ -1262,6 +1262,17 @@ func (ms *MethodSpec) setWriteQueryParamStatements( return nil } +// makeUniqIdent appends an integer to the identifier name if there is duplication already +// The reason for this is to disambiguate a query param "deviceID" from "device_ID" - yes people did do that +func makeUniqIdent(identifier string, seen map[string]int) string { + count := seen[identifier] + seen[identifier] = count + 1 + if count > 0 { + return identifier + strconv.Itoa(count) + } + return identifier +} + func (ms *MethodSpec) setParseQueryParamStatements( funcSpec *compile.FunctionSpec, packageHelper *PackageHelper, hasNoBody bool, ) error { @@ -1271,6 +1282,7 @@ func (ms *MethodSpec) setParseQueryParamStatements( var finalError error var stack = []string{} + seenIdents := map[string]int{} visitor := func( goPrefix string, thriftPrefix string, field *compile.FieldSpec, @@ -1356,9 +1368,10 @@ func (ms *MethodSpec) setParseQueryParamStatements( return false } - identifierName := CamelCase(longQueryName) + "Query" + baseIdent := makeUniqIdent(CamelCase(longQueryName), seenIdents) + identifierName := baseIdent + "Query" + okIdentifierName := baseIdent + "Ok" - okIdentifierName := CamelCase(longQueryName) + "Ok" if field.Required { statements.appendf("%s := req.CheckQueryValue(%q)", okIdentifierName, shortQueryParam, diff --git a/examples/example-gateway/build/clients/bar/bar.go b/examples/example-gateway/build/clients/bar/bar.go index 25922e910..b443f085a 100644 --- a/examples/example-gateway/build/clients/bar/bar.go +++ b/examples/example-gateway/build/clients/bar/bar.go @@ -58,6 +58,11 @@ type Client interface { reqHeaders map[string]string, args *clientsBarBar.Bar_ArgWithManyQueryParams_Args, ) (*clientsBarBar.BarResponse, map[string]string, error) + ArgWithNearDupQueryParams( + ctx context.Context, + reqHeaders map[string]string, + args *clientsBarBar.Bar_ArgWithNearDupQueryParams_Args, + ) (*clientsBarBar.BarResponse, map[string]string, error) ArgWithNestedQueryParams( ctx context.Context, reqHeaders map[string]string, @@ -83,11 +88,6 @@ type Client interface { reqHeaders map[string]string, args *clientsBarBar.Bar_ArgWithQueryParams_Args, ) (*clientsBarBar.BarResponse, map[string]string, error) - ArgWithUntaggedNestedQueryParams( - ctx context.Context, - reqHeaders map[string]string, - args *clientsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args, - ) (*clientsBarBar.BarResponse, map[string]string, error) DeleteFoo( ctx context.Context, reqHeaders map[string]string, @@ -247,40 +247,40 @@ func NewClient(deps *module.Dependencies) Client { deps.Default.Logger, deps.Default.ContextMetrics, "bar", map[string]string{ - "ArgNotStruct": "Bar::argNotStruct", - "ArgWithHeaders": "Bar::argWithHeaders", - "ArgWithManyQueryParams": "Bar::argWithManyQueryParams", - "ArgWithNestedQueryParams": "Bar::argWithNestedQueryParams", - "ArgWithParams": "Bar::argWithParams", - "ArgWithParamsAndDuplicateFields": "Bar::argWithParamsAndDuplicateFields", - "ArgWithQueryHeader": "Bar::argWithQueryHeader", - "ArgWithQueryParams": "Bar::argWithQueryParams", - "ArgWithUntaggedNestedQueryParams": "Bar::argWithUntaggedNestedQueryParams", - "DeleteFoo": "Bar::deleteFoo", - "DeleteWithQueryParams": "Bar::deleteWithQueryParams", - "Hello": "Bar::helloWorld", - "ListAndEnum": "Bar::listAndEnum", - "MissingArg": "Bar::missingArg", - "NoRequest": "Bar::noRequest", - "Normal": "Bar::normal", - "NormalRecur": "Bar::normalRecur", - "TooManyArgs": "Bar::tooManyArgs", - "EchoBinary": "Echo::echoBinary", - "EchoBool": "Echo::echoBool", - "EchoDouble": "Echo::echoDouble", - "EchoEnum": "Echo::echoEnum", - "EchoI16": "Echo::echoI16", - "EchoI32": "Echo::echoI32", - "EchoI32Map": "Echo::echoI32Map", - "EchoI64": "Echo::echoI64", - "EchoI8": "Echo::echoI8", - "EchoString": "Echo::echoString", - "EchoStringList": "Echo::echoStringList", - "EchoStringMap": "Echo::echoStringMap", - "EchoStringSet": "Echo::echoStringSet", - "EchoStructList": "Echo::echoStructList", - "EchoStructSet": "Echo::echoStructSet", - "EchoTypedef": "Echo::echoTypedef", + "ArgNotStruct": "Bar::argNotStruct", + "ArgWithHeaders": "Bar::argWithHeaders", + "ArgWithManyQueryParams": "Bar::argWithManyQueryParams", + "ArgWithNearDupQueryParams": "Bar::argWithNearDupQueryParams", + "ArgWithNestedQueryParams": "Bar::argWithNestedQueryParams", + "ArgWithParams": "Bar::argWithParams", + "ArgWithParamsAndDuplicateFields": "Bar::argWithParamsAndDuplicateFields", + "ArgWithQueryHeader": "Bar::argWithQueryHeader", + "ArgWithQueryParams": "Bar::argWithQueryParams", + "DeleteFoo": "Bar::deleteFoo", + "DeleteWithQueryParams": "Bar::deleteWithQueryParams", + "Hello": "Bar::helloWorld", + "ListAndEnum": "Bar::listAndEnum", + "MissingArg": "Bar::missingArg", + "NoRequest": "Bar::noRequest", + "Normal": "Bar::normal", + "NormalRecur": "Bar::normalRecur", + "TooManyArgs": "Bar::tooManyArgs", + "EchoBinary": "Echo::echoBinary", + "EchoBool": "Echo::echoBool", + "EchoDouble": "Echo::echoDouble", + "EchoEnum": "Echo::echoEnum", + "EchoI16": "Echo::echoI16", + "EchoI32": "Echo::echoI32", + "EchoI32Map": "Echo::echoI32Map", + "EchoI64": "Echo::echoI64", + "EchoI8": "Echo::echoI8", + "EchoString": "Echo::echoString", + "EchoStringList": "Echo::echoStringList", + "EchoStringMap": "Echo::echoStringMap", + "EchoStringSet": "Echo::echoStringSet", + "EchoStructList": "Echo::echoStructList", + "EchoStructSet": "Echo::echoStructSet", + "EchoTypedef": "Echo::echoTypedef", }, baseURL, defaultHeaders, @@ -640,6 +640,91 @@ func (c *barClient) ArgWithManyQueryParams( } } +// ArgWithNearDupQueryParams calls "/bar/clientArgWithNearDupQueryParams" endpoint. +func (c *barClient) ArgWithNearDupQueryParams( + ctx context.Context, + headers map[string]string, + r *clientsBarBar.Bar_ArgWithNearDupQueryParams_Args, +) (*clientsBarBar.BarResponse, map[string]string, error) { + reqUUID := zanzibar.RequestUUIDFromCtx(ctx) + if reqUUID != "" { + if headers == nil { + headers = make(map[string]string) + } + headers[c.requestUUIDHeaderKey] = reqUUID + } + + var defaultRes *clientsBarBar.BarResponse + req := zanzibar.NewClientHTTPRequest(ctx, c.clientID, "ArgWithNearDupQueryParams", "Bar::argWithNearDupQueryParams", c.httpClient) + + // Generate full URL. + fullURL := c.httpClient.BaseURL + "/bar" + "/clientArgWithNearDupQueryParams" + + queryValues := &url.Values{} + oneQuery := r.One + queryValues.Set("one", oneQuery) + if r.Two != nil { + twoQuery := strconv.Itoa(int(*r.Two)) + queryValues.Set("two", twoQuery) + } + if r.Three != nil { + oneNamEQuery := *r.Three + queryValues.Set("One_NamE", oneNamEQuery) + } + if r.Four != nil { + oneNameQuery := *r.Four + queryValues.Set("one-Name", oneNameQuery) + } + fullURL += "?" + queryValues.Encode() + + err := req.WriteJSON("GET", fullURL, headers, nil) + if err != nil { + return defaultRes, nil, err + } + + var res *zanzibar.ClientHTTPResponse + if c.circuitBreakerDisabled { + res, err = req.Do() + } else { + err = hystrix.DoC(ctx, "bar", func(ctx context.Context) error { + res, err = req.Do() + return err + }, nil) + } + if err != nil { + return defaultRes, nil, err + } + + respHeaders := map[string]string{} + for k := range res.Header { + respHeaders[k] = res.Header.Get(k) + } + + res.CheckOKResponse([]int{200}) + + switch res.StatusCode { + case 200: + var responseBody clientsBarBar.BarResponse + err = res.ReadAndUnmarshalBody(&responseBody) + if err != nil { + return defaultRes, respHeaders, err + } + // TODO(jakev): read response headers and put them in body + + return &responseBody, respHeaders, nil + default: + _, err = res.ReadAll() + if err != nil { + return defaultRes, respHeaders, err + } + } + + return defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ + StatusCode: res.StatusCode, + RawBody: res.GetRawBody(), + } +} + // ArgWithNestedQueryParams calls "/bar/argWithNestedQueryParams" endpoint. func (c *barClient) ArgWithNestedQueryParams( ctx context.Context, @@ -1038,114 +1123,6 @@ func (c *barClient) ArgWithQueryParams( } } -// ArgWithUntaggedNestedQueryParams calls "/bar/argWithUntaggedNestedQueryParams" endpoint. -func (c *barClient) ArgWithUntaggedNestedQueryParams( - ctx context.Context, - headers map[string]string, - r *clientsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args, -) (*clientsBarBar.BarResponse, map[string]string, error) { - reqUUID := zanzibar.RequestUUIDFromCtx(ctx) - if reqUUID != "" { - if headers == nil { - headers = make(map[string]string) - } - headers[c.requestUUIDHeaderKey] = reqUUID - } - - var defaultRes *clientsBarBar.BarResponse - req := zanzibar.NewClientHTTPRequest(ctx, c.clientID, "ArgWithUntaggedNestedQueryParams", "Bar::argWithUntaggedNestedQueryParams", c.httpClient) - - // Generate full URL. - fullURL := c.httpClient.BaseURL + "/bar" + "/argWithUntaggedNestedQueryParams" - - if r.Request == nil { - return nil, nil, errors.New( - "The field .Request is required", - ) - } - queryValues := &url.Values{} - requestNameQuery := r.Request.Name - queryValues.Set("request.name", requestNameQuery) - if r.Request.UserUUID != nil { - requestUserUUIDQuery := *r.Request.UserUUID - queryValues.Set("request.userUUID", requestUserUUIDQuery) - } - requestCountQuery := strconv.Itoa(int(r.Request.Count)) - queryValues.Set("request.count", requestCountQuery) - if r.Request.OptCount != nil { - requestOptCountQuery := strconv.Itoa(int(*r.Request.OptCount)) - queryValues.Set("request.optCount", requestOptCountQuery) - } - for _, value := range r.Request.Foos { - queryValues.Add("request.foos", value) - } - if r.Opt != nil { - optNameQuery := r.Opt.Name - queryValues.Set("opt.name", optNameQuery) - if r.Opt.UserUUID != nil { - optUserUUIDQuery := *r.Opt.UserUUID - queryValues.Set("opt.userUUID", optUserUUIDQuery) - } - optCountQuery := strconv.Itoa(int(r.Opt.Count)) - queryValues.Set("opt.count", optCountQuery) - if r.Opt.OptCount != nil { - optOptCountQuery := strconv.Itoa(int(*r.Opt.OptCount)) - queryValues.Set("opt.optCount", optOptCountQuery) - } - for _, value := range r.Opt.Foos { - queryValues.Add("opt.foos", value) - } - } - fullURL += "?" + queryValues.Encode() - - err := req.WriteJSON("GET", fullURL, headers, nil) - if err != nil { - return defaultRes, nil, err - } - - var res *zanzibar.ClientHTTPResponse - if c.circuitBreakerDisabled { - res, err = req.Do() - } else { - err = hystrix.DoC(ctx, "bar", func(ctx context.Context) error { - res, err = req.Do() - return err - }, nil) - } - if err != nil { - return defaultRes, nil, err - } - - respHeaders := map[string]string{} - for k := range res.Header { - respHeaders[k] = res.Header.Get(k) - } - - res.CheckOKResponse([]int{200}) - - switch res.StatusCode { - case 200: - var responseBody clientsBarBar.BarResponse - err = res.ReadAndUnmarshalBody(&responseBody) - if err != nil { - return defaultRes, respHeaders, err - } - // TODO(jakev): read response headers and put them in body - - return &responseBody, respHeaders, nil - default: - _, err = res.ReadAll() - if err != nil { - return defaultRes, respHeaders, err - } - } - - return defaultRes, respHeaders, &zanzibar.UnexpectedHTTPError{ - StatusCode: res.StatusCode, - RawBody: res.GetRawBody(), - } -} - // DeleteFoo calls "/bar/foo" endpoint. func (c *barClient) DeleteFoo( ctx context.Context, diff --git a/examples/example-gateway/build/clients/bar/mock-client/mock_client.go b/examples/example-gateway/build/clients/bar/mock-client/mock_client.go index 57c270b99..3cc6a1c9e 100644 --- a/examples/example-gateway/build/clients/bar/mock-client/mock_client.go +++ b/examples/example-gateway/build/clients/bar/mock-client/mock_client.go @@ -83,6 +83,22 @@ func (mr *MockClientMockRecorder) ArgWithManyQueryParams(arg0, arg1, arg2 interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ArgWithManyQueryParams", reflect.TypeOf((*MockClient)(nil).ArgWithManyQueryParams), arg0, arg1, arg2) } +// ArgWithNearDupQueryParams mocks base method +func (m *MockClient) ArgWithNearDupQueryParams(arg0 context.Context, arg1 map[string]string, arg2 *bar.Bar_ArgWithNearDupQueryParams_Args) (*bar.BarResponse, map[string]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ArgWithNearDupQueryParams", arg0, arg1, arg2) + ret0, _ := ret[0].(*bar.BarResponse) + ret1, _ := ret[1].(map[string]string) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// ArgWithNearDupQueryParams indicates an expected call of ArgWithNearDupQueryParams +func (mr *MockClientMockRecorder) ArgWithNearDupQueryParams(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ArgWithNearDupQueryParams", reflect.TypeOf((*MockClient)(nil).ArgWithNearDupQueryParams), arg0, arg1, arg2) +} + // ArgWithNestedQueryParams mocks base method func (m *MockClient) ArgWithNestedQueryParams(arg0 context.Context, arg1 map[string]string, arg2 *bar.Bar_ArgWithNestedQueryParams_Args) (*bar.BarResponse, map[string]string, error) { m.ctrl.T.Helper() @@ -163,22 +179,6 @@ func (mr *MockClientMockRecorder) ArgWithQueryParams(arg0, arg1, arg2 interface{ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ArgWithQueryParams", reflect.TypeOf((*MockClient)(nil).ArgWithQueryParams), arg0, arg1, arg2) } -// ArgWithUntaggedNestedQueryParams mocks base method -func (m *MockClient) ArgWithUntaggedNestedQueryParams(arg0 context.Context, arg1 map[string]string, arg2 *bar.Bar_ArgWithUntaggedNestedQueryParams_Args) (*bar.BarResponse, map[string]string, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ArgWithUntaggedNestedQueryParams", arg0, arg1, arg2) - ret0, _ := ret[0].(*bar.BarResponse) - ret1, _ := ret[1].(map[string]string) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// ArgWithUntaggedNestedQueryParams indicates an expected call of ArgWithUntaggedNestedQueryParams -func (mr *MockClientMockRecorder) ArgWithUntaggedNestedQueryParams(arg0, arg1, arg2 interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ArgWithUntaggedNestedQueryParams", reflect.TypeOf((*MockClient)(nil).ArgWithUntaggedNestedQueryParams), arg0, arg1, arg2) -} - // DeleteFoo mocks base method func (m *MockClient) DeleteFoo(arg0 context.Context, arg1 map[string]string, arg2 *bar.Bar_DeleteFoo_Args) (map[string]string, error) { m.ctrl.T.Helper() diff --git a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithuntaggednestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go similarity index 59% rename from examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithuntaggednestedqueryparams.go rename to examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go index 0642ab194..ea3fce5b5 100644 --- a/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithuntaggednestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/bar_bar_method_argwithneardupqueryparams.go @@ -46,20 +46,20 @@ import ( module "github.com/uber/zanzibar/examples/example-gateway/build/endpoints/bar/module" ) -// BarArgWithUntaggedNestedQueryParamsHandler is the handler for "/bar/argWithUntaggedNestedQueryParams" -type BarArgWithUntaggedNestedQueryParamsHandler struct { +// BarArgWithNearDupQueryParamsHandler is the handler for "/bar/argWithNearDupQueryParams" +type BarArgWithNearDupQueryParamsHandler struct { Dependencies *module.Dependencies endpoint *zanzibar.RouterEndpoint } -// NewBarArgWithUntaggedNestedQueryParamsHandler creates a handler -func NewBarArgWithUntaggedNestedQueryParamsHandler(deps *module.Dependencies) *BarArgWithUntaggedNestedQueryParamsHandler { - handler := &BarArgWithUntaggedNestedQueryParamsHandler{ +// NewBarArgWithNearDupQueryParamsHandler creates a handler +func NewBarArgWithNearDupQueryParamsHandler(deps *module.Dependencies) *BarArgWithNearDupQueryParamsHandler { + handler := &BarArgWithNearDupQueryParamsHandler{ Dependencies: deps, } handler.endpoint = zanzibar.NewRouterEndpoint( deps.Default.ContextExtractor, deps.Default, - "bar", "argWithUntaggedNestedQueryParams", + "bar", "argWithNearDupQueryParams", zanzibar.NewStack([]zanzibar.MiddlewareHandle{ deps.Middleware.DefaultExample2.NewMiddlewareHandle( defaultExample2.Options{}, @@ -74,15 +74,15 @@ func NewBarArgWithUntaggedNestedQueryParamsHandler(deps *module.Dependencies) *B } // Register adds the http handler to the gateway's http router -func (h *BarArgWithUntaggedNestedQueryParamsHandler) Register(g *zanzibar.Gateway) error { +func (h *BarArgWithNearDupQueryParamsHandler) Register(g *zanzibar.Gateway) error { return g.HTTPRouter.Handle( - "GET", "/bar/argWithUntaggedNestedQueryParams", + "GET", "/bar/argWithNearDupQueryParams", http.HandlerFunc(h.endpoint.HandleRequest), ) } -// HandleRequest handles "/bar/argWithUntaggedNestedQueryParams". -func (h *BarArgWithUntaggedNestedQueryParamsHandler) HandleRequest( +// HandleRequest handles "/bar/argWithNearDupQueryParams". +func (h *BarArgWithNearDupQueryParamsHandler) HandleRequest( ctx context.Context, req *zanzibar.ServerHTTPRequest, res *zanzibar.ServerHTTPResponse, @@ -103,117 +103,43 @@ func (h *BarArgWithUntaggedNestedQueryParamsHandler) HandleRequest( } }() - var requestBody endpointsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args + var requestBody endpointsBarBar.Bar_ArgWithNearDupQueryParams_Args - if requestBody.Request == nil { - requestBody.Request = &endpointsBarBar.QueryParamsUntaggedStruct{} - } - requestNameOk := req.CheckQueryValue("request.name") - if !requestNameOk { + oneNameOk := req.CheckQueryValue("oneName") + if !oneNameOk { return } - requestNameQuery, ok := req.GetQueryValue("request.name") + oneNameQuery, ok := req.GetQueryValue("oneName") if !ok { return } - requestBody.Request.Name = requestNameQuery + requestBody.One = oneNameQuery - requestUserUUIDOk := req.HasQueryValue("request.userUUID") - if requestUserUUIDOk { - requestUserUUIDQuery, ok := req.GetQueryValue("request.userUUID") + oneName1Ok := req.HasQueryValue("one_name") + if oneName1Ok { + oneName1Query, ok := req.GetQueryInt32("one_name") if !ok { return } - requestBody.Request.UserUUID = ptr.String(requestUserUUIDQuery) - } - - requestCountOk := req.CheckQueryValue("request.count") - if !requestCountOk { - return - } - requestCountQuery, ok := req.GetQueryInt32("request.count") - if !ok { - return + requestBody.Two = ptr.Int32(oneName1Query) } - requestBody.Request.Count = requestCountQuery - requestOptCountOk := req.HasQueryValue("request.optCount") - if requestOptCountOk { - requestOptCountQuery, ok := req.GetQueryInt32("request.optCount") + oneNamEOk := req.HasQueryValue("One_NamE") + if oneNamEOk { + oneNamEQuery, ok := req.GetQueryValue("One_NamE") if !ok { return } - requestBody.Request.OptCount = ptr.Int32(requestOptCountQuery) + requestBody.Three = ptr.String(oneNamEQuery) } - requestFoosOk := req.CheckQueryValue("request.foos") - if !requestFoosOk { - return - } - requestFoosQuery, ok := req.GetQueryValueList("request.foos") - if !ok { - return - } - requestBody.Request.Foos = requestFoosQuery - - var _queryNeeded bool - for _, _pfx := range []string{"opt", "opt.name", "opt.useruuid", "opt.count", "opt.optcount", "opt.foos"} { - if _queryNeeded = req.HasQueryPrefix(_pfx); _queryNeeded { - break - } - } - if _queryNeeded { - if requestBody.Opt == nil { - requestBody.Opt = &endpointsBarBar.QueryParamsUntaggedOptStruct{} - } - optNameOk := req.CheckQueryValue("opt.name") - if !optNameOk { - return - } - optNameQuery, ok := req.GetQueryValue("opt.name") + oneName2Ok := req.HasQueryValue("one-Name") + if oneName2Ok { + oneName2Query, ok := req.GetQueryValue("one-Name") if !ok { return } - requestBody.Opt.Name = optNameQuery - - optUserUUIDOk := req.HasQueryValue("opt.userUUID") - if optUserUUIDOk { - optUserUUIDQuery, ok := req.GetQueryValue("opt.userUUID") - if !ok { - return - } - requestBody.Opt.UserUUID = ptr.String(optUserUUIDQuery) - } - - optCountOk := req.CheckQueryValue("opt.count") - if !optCountOk { - return - } - optCountQuery, ok := req.GetQueryInt32("opt.count") - if !ok { - return - } - requestBody.Opt.Count = optCountQuery - - optOptCountOk := req.HasQueryValue("opt.optCount") - if optOptCountOk { - optOptCountQuery, ok := req.GetQueryInt32("opt.optCount") - if !ok { - return - } - requestBody.Opt.OptCount = ptr.Int32(optOptCountQuery) - } - - optFoosOk := req.CheckQueryValue("opt.foos") - if !optFoosOk { - return - } - optFoosQuery, ok := req.GetQueryValueList("opt.foos") - if !ok { - return - } - requestBody.Opt.Foos = optFoosQuery - + requestBody.Four = ptr.String(oneName2Query) } // log endpoint request to downstream services @@ -230,7 +156,7 @@ func (h *BarArgWithUntaggedNestedQueryParamsHandler) HandleRequest( h.Dependencies.Default.ContextLogger.Debug(ctx, "endpoint request to downstream", zfields...) } - w := workflow.NewBarArgWithUntaggedNestedQueryParamsWorkflow(h.Dependencies) + w := workflow.NewBarArgWithNearDupQueryParamsWorkflow(h.Dependencies) if span := req.GetSpan(); span != nil { ctx = opentracing.ContextWithSpan(ctx, span) } diff --git a/examples/example-gateway/build/endpoints/bar/endpoint.go b/examples/example-gateway/build/endpoints/bar/endpoint.go index c54e7de6d..9500a55a7 100644 --- a/examples/example-gateway/build/endpoints/bar/endpoint.go +++ b/examples/example-gateway/build/endpoints/bar/endpoint.go @@ -37,41 +37,41 @@ type Endpoint interface { // a gateway func NewEndpoint(deps *module.Dependencies) Endpoint { return &EndpointHandlers{ - BarArgNotStructHandler: NewBarArgNotStructHandler(deps), - BarArgWithHeadersHandler: NewBarArgWithHeadersHandler(deps), - BarArgWithQueryParamsHandler: NewBarArgWithQueryParamsHandler(deps), - BarArgWithNestedQueryParamsHandler: NewBarArgWithNestedQueryParamsHandler(deps), - BarArgWithUntaggedNestedQueryParamsHandler: NewBarArgWithUntaggedNestedQueryParamsHandler(deps), - BarArgWithQueryHeaderHandler: NewBarArgWithQueryHeaderHandler(deps), - BarArgWithParamsHandler: NewBarArgWithParamsHandler(deps), - BarArgWithManyQueryParamsHandler: NewBarArgWithManyQueryParamsHandler(deps), - BarMissingArgHandler: NewBarMissingArgHandler(deps), - BarNoRequestHandler: NewBarNoRequestHandler(deps), - BarNormalHandler: NewBarNormalHandler(deps), - BarTooManyArgsHandler: NewBarTooManyArgsHandler(deps), - BarHelloWorldHandler: NewBarHelloWorldHandler(deps), - BarListAndEnumHandler: NewBarListAndEnumHandler(deps), - BarArgWithParamsAndDuplicateFieldsHandler: NewBarArgWithParamsAndDuplicateFieldsHandler(deps), + BarArgNotStructHandler: NewBarArgNotStructHandler(deps), + BarArgWithHeadersHandler: NewBarArgWithHeadersHandler(deps), + BarArgWithQueryParamsHandler: NewBarArgWithQueryParamsHandler(deps), + BarArgWithNestedQueryParamsHandler: NewBarArgWithNestedQueryParamsHandler(deps), + BarArgWithNearDupQueryParamsHandler: NewBarArgWithNearDupQueryParamsHandler(deps), + BarArgWithQueryHeaderHandler: NewBarArgWithQueryHeaderHandler(deps), + BarArgWithParamsHandler: NewBarArgWithParamsHandler(deps), + BarArgWithManyQueryParamsHandler: NewBarArgWithManyQueryParamsHandler(deps), + BarMissingArgHandler: NewBarMissingArgHandler(deps), + BarNoRequestHandler: NewBarNoRequestHandler(deps), + BarNormalHandler: NewBarNormalHandler(deps), + BarTooManyArgsHandler: NewBarTooManyArgsHandler(deps), + BarHelloWorldHandler: NewBarHelloWorldHandler(deps), + BarListAndEnumHandler: NewBarListAndEnumHandler(deps), + BarArgWithParamsAndDuplicateFieldsHandler: NewBarArgWithParamsAndDuplicateFieldsHandler(deps), } } // EndpointHandlers is a collection of individual endpoint handlers type EndpointHandlers struct { - BarArgNotStructHandler *BarArgNotStructHandler - BarArgWithHeadersHandler *BarArgWithHeadersHandler - BarArgWithQueryParamsHandler *BarArgWithQueryParamsHandler - BarArgWithNestedQueryParamsHandler *BarArgWithNestedQueryParamsHandler - BarArgWithUntaggedNestedQueryParamsHandler *BarArgWithUntaggedNestedQueryParamsHandler - BarArgWithQueryHeaderHandler *BarArgWithQueryHeaderHandler - BarArgWithParamsHandler *BarArgWithParamsHandler - BarArgWithManyQueryParamsHandler *BarArgWithManyQueryParamsHandler - BarMissingArgHandler *BarMissingArgHandler - BarNoRequestHandler *BarNoRequestHandler - BarNormalHandler *BarNormalHandler - BarTooManyArgsHandler *BarTooManyArgsHandler - BarHelloWorldHandler *BarHelloWorldHandler - BarListAndEnumHandler *BarListAndEnumHandler - BarArgWithParamsAndDuplicateFieldsHandler *BarArgWithParamsAndDuplicateFieldsHandler + BarArgNotStructHandler *BarArgNotStructHandler + BarArgWithHeadersHandler *BarArgWithHeadersHandler + BarArgWithQueryParamsHandler *BarArgWithQueryParamsHandler + BarArgWithNestedQueryParamsHandler *BarArgWithNestedQueryParamsHandler + BarArgWithNearDupQueryParamsHandler *BarArgWithNearDupQueryParamsHandler + BarArgWithQueryHeaderHandler *BarArgWithQueryHeaderHandler + BarArgWithParamsHandler *BarArgWithParamsHandler + BarArgWithManyQueryParamsHandler *BarArgWithManyQueryParamsHandler + BarMissingArgHandler *BarMissingArgHandler + BarNoRequestHandler *BarNoRequestHandler + BarNormalHandler *BarNormalHandler + BarTooManyArgsHandler *BarTooManyArgsHandler + BarHelloWorldHandler *BarHelloWorldHandler + BarListAndEnumHandler *BarListAndEnumHandler + BarArgWithParamsAndDuplicateFieldsHandler *BarArgWithParamsAndDuplicateFieldsHandler } // Register registers the endpoint handlers with the gateway @@ -92,7 +92,7 @@ func (handlers *EndpointHandlers) Register(gateway *zanzibar.Gateway) error { if err3 != nil { return err3 } - err4 := handlers.BarArgWithUntaggedNestedQueryParamsHandler.Register(gateway) + err4 := handlers.BarArgWithNearDupQueryParamsHandler.Register(gateway) if err4 != nil { return err4 } diff --git a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithuntaggednestedqueryparams.go b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go similarity index 68% rename from examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithuntaggednestedqueryparams.go rename to examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go index dbe0e828f..79ef8e7d2 100644 --- a/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithuntaggednestedqueryparams.go +++ b/examples/example-gateway/build/endpoints/bar/workflow/bar_bar_method_argwithneardupqueryparams.go @@ -38,17 +38,17 @@ import ( "go.uber.org/zap" ) -// BarArgWithUntaggedNestedQueryParamsWorkflow defines the interface for BarArgWithUntaggedNestedQueryParams workflow -type BarArgWithUntaggedNestedQueryParamsWorkflow interface { +// BarArgWithNearDupQueryParamsWorkflow defines the interface for BarArgWithNearDupQueryParams workflow +type BarArgWithNearDupQueryParamsWorkflow interface { Handle( ctx context.Context, reqHeaders zanzibar.Header, - r *endpointsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args, + r *endpointsBarBar.Bar_ArgWithNearDupQueryParams_Args, ) (*endpointsBarBar.BarResponse, zanzibar.Header, error) } -// NewBarArgWithUntaggedNestedQueryParamsWorkflow creates a workflow -func NewBarArgWithUntaggedNestedQueryParamsWorkflow(deps *module.Dependencies) BarArgWithUntaggedNestedQueryParamsWorkflow { +// NewBarArgWithNearDupQueryParamsWorkflow creates a workflow +func NewBarArgWithNearDupQueryParamsWorkflow(deps *module.Dependencies) BarArgWithNearDupQueryParamsWorkflow { var whitelistedDynamicHeaders []string if deps.Default.Config.ContainsKey("clients.bar.alternates") { var alternateServiceDetail config.AlternateServiceDetail @@ -58,27 +58,27 @@ func NewBarArgWithUntaggedNestedQueryParamsWorkflow(deps *module.Dependencies) B } } - return &barArgWithUntaggedNestedQueryParamsWorkflow{ + return &barArgWithNearDupQueryParamsWorkflow{ Clients: deps.Client, Logger: deps.Default.Logger, whitelistedDynamicHeaders: whitelistedDynamicHeaders, } } -// barArgWithUntaggedNestedQueryParamsWorkflow calls thrift client Bar.ArgWithUntaggedNestedQueryParams -type barArgWithUntaggedNestedQueryParamsWorkflow struct { +// barArgWithNearDupQueryParamsWorkflow calls thrift client Bar.ArgWithNearDupQueryParams +type barArgWithNearDupQueryParamsWorkflow struct { Clients *module.ClientDependencies Logger *zap.Logger whitelistedDynamicHeaders []string } // Handle calls thrift client. -func (w barArgWithUntaggedNestedQueryParamsWorkflow) Handle( +func (w barArgWithNearDupQueryParamsWorkflow) Handle( ctx context.Context, reqHeaders zanzibar.Header, - r *endpointsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args, + r *endpointsBarBar.Bar_ArgWithNearDupQueryParams_Args, ) (*endpointsBarBar.BarResponse, zanzibar.Header, error) { - clientRequest := convertToArgWithUntaggedNestedQueryParamsClientRequest(r) + clientRequest := convertToArgWithNearDupQueryParamsClientRequest(r) clientHeaders := map[string]string{} @@ -95,7 +95,7 @@ func (w barArgWithUntaggedNestedQueryParamsWorkflow) Handle( } } - clientRespBody, _, err := w.Clients.Bar.ArgWithUntaggedNestedQueryParams( + clientRespBody, _, err := w.Clients.Bar.ArgWithNearDupQueryParams( ctx, clientHeaders, clientRequest, ) @@ -116,44 +116,22 @@ func (w barArgWithUntaggedNestedQueryParamsWorkflow) Handle( // Filter and map response headers from client to server response. resHeaders := zanzibar.ServerHTTPHeader{} - response := convertBarArgWithUntaggedNestedQueryParamsClientResponse(clientRespBody) + response := convertBarArgWithNearDupQueryParamsClientResponse(clientRespBody) return response, resHeaders, nil } -func convertToArgWithUntaggedNestedQueryParamsClientRequest(in *endpointsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args) *clientsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args { - out := &clientsBarBar.Bar_ArgWithUntaggedNestedQueryParams_Args{} - - if in.Request != nil { - out.Request = &clientsBarBar.QueryParamsUntaggedStruct{} - out.Request.Name = string(in.Request.Name) - out.Request.UserUUID = (*string)(in.Request.UserUUID) - out.Request.Count = int32(in.Request.Count) - out.Request.OptCount = (*int32)(in.Request.OptCount) - out.Request.Foos = make([]string, len(in.Request.Foos)) - for index1, value2 := range in.Request.Foos { - out.Request.Foos[index1] = string(value2) - } - } else { - out.Request = nil - } - if in.Opt != nil { - out.Opt = &clientsBarBar.QueryParamsUntaggedOptStruct{} - out.Opt.Name = string(in.Opt.Name) - out.Opt.UserUUID = (*string)(in.Opt.UserUUID) - out.Opt.Count = int32(in.Opt.Count) - out.Opt.OptCount = (*int32)(in.Opt.OptCount) - out.Opt.Foos = make([]string, len(in.Opt.Foos)) - for index3, value4 := range in.Opt.Foos { - out.Opt.Foos[index3] = string(value4) - } - } else { - out.Opt = nil - } +func convertToArgWithNearDupQueryParamsClientRequest(in *endpointsBarBar.Bar_ArgWithNearDupQueryParams_Args) *clientsBarBar.Bar_ArgWithNearDupQueryParams_Args { + out := &clientsBarBar.Bar_ArgWithNearDupQueryParams_Args{} + + out.One = string(in.One) + out.Two = (*int32)(in.Two) + out.Three = (*string)(in.Three) + out.Four = (*string)(in.Four) return out } -func convertBarArgWithUntaggedNestedQueryParamsClientResponse(in *clientsBarBar.BarResponse) *endpointsBarBar.BarResponse { +func convertBarArgWithNearDupQueryParamsClientResponse(in *clientsBarBar.BarResponse) *endpointsBarBar.BarResponse { out := &endpointsBarBar.BarResponse{} out.StringField = string(in.StringField) diff --git a/examples/example-gateway/build/gen-code/clients/bar/bar/bar.go b/examples/example-gateway/build/gen-code/clients/bar/bar/bar.go index bca969bc4..87e76c57f 100644 --- a/examples/example-gateway/build/gen-code/clients/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/clients/bar/bar/bar.go @@ -2563,614 +2563,6 @@ func (v *QueryParamsStruct) IsSetFoo() bool { return v != nil && v.Foo != nil } -type QueryParamsUntaggedOptStruct struct { - Name string `json:"name,required"` - UserUUID *string `json:"userUUID,omitempty"` - Count int32 `json:"count,required"` - OptCount *int32 `json:"optCount,omitempty"` - Foos []string `json:"foos,required"` -} - -// ToWire translates a QueryParamsUntaggedOptStruct struct into a Thrift-level intermediate -// representation. This intermediate representation may be serialized -// into bytes using a ThriftRW protocol implementation. -// -// An error is returned if the struct or any of its fields failed to -// validate. -// -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } -func (v *QueryParamsUntaggedOptStruct) ToWire() (wire.Value, error) { - var ( - fields [5]wire.Field - i int = 0 - w wire.Value - err error - ) - - w, err = wire.NewValueString(v.Name), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ - if v.UserUUID != nil { - w, err = wire.NewValueString(*(v.UserUUID)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 2, Value: w} - i++ - } - - w, err = wire.NewValueI32(v.Count), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 3, Value: w} - i++ - if v.OptCount != nil { - w, err = wire.NewValueI32(*(v.OptCount)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 4, Value: w} - i++ - } - if v.Foos == nil { - return w, errors.New("field Foos of QueryParamsUntaggedOptStruct is required") - } - w, err = wire.NewValueList(_List_String_ValueList(v.Foos)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 5, Value: w} - i++ - - return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil -} - -// FromWire deserializes a QueryParamsUntaggedOptStruct struct from its Thrift-level -// representation. The Thrift-level representation may be obtained -// from a ThriftRW protocol implementation. -// -// An error is returned if we were unable to build a QueryParamsUntaggedOptStruct struct -// from the provided intermediate representation. -// -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } -// -// var v QueryParamsUntaggedOptStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil -func (v *QueryParamsUntaggedOptStruct) FromWire(w wire.Value) error { - var err error - - nameIsSet := false - - countIsSet := false - - foosIsSet := false - - for _, field := range w.GetStruct().Fields { - switch field.ID { - case 1: - if field.Value.Type() == wire.TBinary { - v.Name, err = field.Value.GetString(), error(nil) - if err != nil { - return err - } - nameIsSet = true - } - case 2: - if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.UserUUID = &x - if err != nil { - return err - } - - } - case 3: - if field.Value.Type() == wire.TI32 { - v.Count, err = field.Value.GetI32(), error(nil) - if err != nil { - return err - } - countIsSet = true - } - case 4: - if field.Value.Type() == wire.TI32 { - var x int32 - x, err = field.Value.GetI32(), error(nil) - v.OptCount = &x - if err != nil { - return err - } - - } - case 5: - if field.Value.Type() == wire.TList { - v.Foos, err = _List_String_Read(field.Value.GetList()) - if err != nil { - return err - } - foosIsSet = true - } - } - } - - if !nameIsSet { - return errors.New("field Name of QueryParamsUntaggedOptStruct is required") - } - - if !countIsSet { - return errors.New("field Count of QueryParamsUntaggedOptStruct is required") - } - - if !foosIsSet { - return errors.New("field Foos of QueryParamsUntaggedOptStruct is required") - } - - return nil -} - -// String returns a readable string representation of a QueryParamsUntaggedOptStruct -// struct. -func (v *QueryParamsUntaggedOptStruct) String() string { - if v == nil { - return "" - } - - var fields [5]string - i := 0 - fields[i] = fmt.Sprintf("Name: %v", v.Name) - i++ - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } - fields[i] = fmt.Sprintf("Count: %v", v.Count) - i++ - if v.OptCount != nil { - fields[i] = fmt.Sprintf("OptCount: %v", *(v.OptCount)) - i++ - } - fields[i] = fmt.Sprintf("Foos: %v", v.Foos) - i++ - - return fmt.Sprintf("QueryParamsUntaggedOptStruct{%v}", strings.Join(fields[:i], ", ")) -} - -func _I32_EqualsPtr(lhs, rhs *int32) bool { - if lhs != nil && rhs != nil { - - x := *lhs - y := *rhs - return (x == y) - } - return lhs == nil && rhs == nil -} - -// Equals returns true if all the fields of this QueryParamsUntaggedOptStruct match the -// provided QueryParamsUntaggedOptStruct. -// -// This function performs a deep comparison. -func (v *QueryParamsUntaggedOptStruct) Equals(rhs *QueryParamsUntaggedOptStruct) bool { - if v == nil { - return rhs == nil - } else if rhs == nil { - return false - } - if !(v.Name == rhs.Name) { - return false - } - if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { - return false - } - if !(v.Count == rhs.Count) { - return false - } - if !_I32_EqualsPtr(v.OptCount, rhs.OptCount) { - return false - } - if !_List_String_Equals(v.Foos, rhs.Foos) { - return false - } - - return true -} - -// MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of QueryParamsUntaggedOptStruct. -func (v *QueryParamsUntaggedOptStruct) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { - if v == nil { - return nil - } - enc.AddString("name", v.Name) - if v.UserUUID != nil { - enc.AddString("userUUID", *v.UserUUID) - } - enc.AddInt32("count", v.Count) - if v.OptCount != nil { - enc.AddInt32("optCount", *v.OptCount) - } - err = multierr.Append(err, enc.AddArray("foos", (_List_String_Zapper)(v.Foos))) - return err -} - -// GetName returns the value of Name if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetName() (o string) { - if v != nil { - o = v.Name - } - return -} - -// GetUserUUID returns the value of UserUUID if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetUserUUID() (o string) { - if v != nil && v.UserUUID != nil { - return *v.UserUUID - } - - return -} - -// IsSetUserUUID returns true if UserUUID is not nil. -func (v *QueryParamsUntaggedOptStruct) IsSetUserUUID() bool { - return v != nil && v.UserUUID != nil -} - -// GetCount returns the value of Count if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetCount() (o int32) { - if v != nil { - o = v.Count - } - return -} - -// GetOptCount returns the value of OptCount if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetOptCount() (o int32) { - if v != nil && v.OptCount != nil { - return *v.OptCount - } - - return -} - -// IsSetOptCount returns true if OptCount is not nil. -func (v *QueryParamsUntaggedOptStruct) IsSetOptCount() bool { - return v != nil && v.OptCount != nil -} - -// GetFoos returns the value of Foos if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetFoos() (o []string) { - if v != nil { - o = v.Foos - } - return -} - -// IsSetFoos returns true if Foos is not nil. -func (v *QueryParamsUntaggedOptStruct) IsSetFoos() bool { - return v != nil && v.Foos != nil -} - -type QueryParamsUntaggedStruct struct { - Name string `json:"name,required"` - UserUUID *string `json:"userUUID,omitempty"` - Count int32 `json:"count,required"` - OptCount *int32 `json:"optCount,omitempty"` - Foos []string `json:"foos,required"` -} - -// ToWire translates a QueryParamsUntaggedStruct struct into a Thrift-level intermediate -// representation. This intermediate representation may be serialized -// into bytes using a ThriftRW protocol implementation. -// -// An error is returned if the struct or any of its fields failed to -// validate. -// -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } -func (v *QueryParamsUntaggedStruct) ToWire() (wire.Value, error) { - var ( - fields [5]wire.Field - i int = 0 - w wire.Value - err error - ) - - w, err = wire.NewValueString(v.Name), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ - if v.UserUUID != nil { - w, err = wire.NewValueString(*(v.UserUUID)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 2, Value: w} - i++ - } - - w, err = wire.NewValueI32(v.Count), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 3, Value: w} - i++ - if v.OptCount != nil { - w, err = wire.NewValueI32(*(v.OptCount)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 4, Value: w} - i++ - } - if v.Foos == nil { - return w, errors.New("field Foos of QueryParamsUntaggedStruct is required") - } - w, err = wire.NewValueList(_List_String_ValueList(v.Foos)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 5, Value: w} - i++ - - return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil -} - -// FromWire deserializes a QueryParamsUntaggedStruct struct from its Thrift-level -// representation. The Thrift-level representation may be obtained -// from a ThriftRW protocol implementation. -// -// An error is returned if we were unable to build a QueryParamsUntaggedStruct struct -// from the provided intermediate representation. -// -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } -// -// var v QueryParamsUntaggedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil -func (v *QueryParamsUntaggedStruct) FromWire(w wire.Value) error { - var err error - - nameIsSet := false - - countIsSet := false - - foosIsSet := false - - for _, field := range w.GetStruct().Fields { - switch field.ID { - case 1: - if field.Value.Type() == wire.TBinary { - v.Name, err = field.Value.GetString(), error(nil) - if err != nil { - return err - } - nameIsSet = true - } - case 2: - if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.UserUUID = &x - if err != nil { - return err - } - - } - case 3: - if field.Value.Type() == wire.TI32 { - v.Count, err = field.Value.GetI32(), error(nil) - if err != nil { - return err - } - countIsSet = true - } - case 4: - if field.Value.Type() == wire.TI32 { - var x int32 - x, err = field.Value.GetI32(), error(nil) - v.OptCount = &x - if err != nil { - return err - } - - } - case 5: - if field.Value.Type() == wire.TList { - v.Foos, err = _List_String_Read(field.Value.GetList()) - if err != nil { - return err - } - foosIsSet = true - } - } - } - - if !nameIsSet { - return errors.New("field Name of QueryParamsUntaggedStruct is required") - } - - if !countIsSet { - return errors.New("field Count of QueryParamsUntaggedStruct is required") - } - - if !foosIsSet { - return errors.New("field Foos of QueryParamsUntaggedStruct is required") - } - - return nil -} - -// String returns a readable string representation of a QueryParamsUntaggedStruct -// struct. -func (v *QueryParamsUntaggedStruct) String() string { - if v == nil { - return "" - } - - var fields [5]string - i := 0 - fields[i] = fmt.Sprintf("Name: %v", v.Name) - i++ - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } - fields[i] = fmt.Sprintf("Count: %v", v.Count) - i++ - if v.OptCount != nil { - fields[i] = fmt.Sprintf("OptCount: %v", *(v.OptCount)) - i++ - } - fields[i] = fmt.Sprintf("Foos: %v", v.Foos) - i++ - - return fmt.Sprintf("QueryParamsUntaggedStruct{%v}", strings.Join(fields[:i], ", ")) -} - -// Equals returns true if all the fields of this QueryParamsUntaggedStruct match the -// provided QueryParamsUntaggedStruct. -// -// This function performs a deep comparison. -func (v *QueryParamsUntaggedStruct) Equals(rhs *QueryParamsUntaggedStruct) bool { - if v == nil { - return rhs == nil - } else if rhs == nil { - return false - } - if !(v.Name == rhs.Name) { - return false - } - if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { - return false - } - if !(v.Count == rhs.Count) { - return false - } - if !_I32_EqualsPtr(v.OptCount, rhs.OptCount) { - return false - } - if !_List_String_Equals(v.Foos, rhs.Foos) { - return false - } - - return true -} - -// MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of QueryParamsUntaggedStruct. -func (v *QueryParamsUntaggedStruct) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { - if v == nil { - return nil - } - enc.AddString("name", v.Name) - if v.UserUUID != nil { - enc.AddString("userUUID", *v.UserUUID) - } - enc.AddInt32("count", v.Count) - if v.OptCount != nil { - enc.AddInt32("optCount", *v.OptCount) - } - err = multierr.Append(err, enc.AddArray("foos", (_List_String_Zapper)(v.Foos))) - return err -} - -// GetName returns the value of Name if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetName() (o string) { - if v != nil { - o = v.Name - } - return -} - -// GetUserUUID returns the value of UserUUID if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetUserUUID() (o string) { - if v != nil && v.UserUUID != nil { - return *v.UserUUID - } - - return -} - -// IsSetUserUUID returns true if UserUUID is not nil. -func (v *QueryParamsUntaggedStruct) IsSetUserUUID() bool { - return v != nil && v.UserUUID != nil -} - -// GetCount returns the value of Count if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetCount() (o int32) { - if v != nil { - o = v.Count - } - return -} - -// GetOptCount returns the value of OptCount if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetOptCount() (o int32) { - if v != nil && v.OptCount != nil { - return *v.OptCount - } - - return -} - -// IsSetOptCount returns true if OptCount is not nil. -func (v *QueryParamsUntaggedStruct) IsSetOptCount() bool { - return v != nil && v.OptCount != nil -} - -// GetFoos returns the value of Foos if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetFoos() (o []string) { - if v != nil { - o = v.Foos - } - return -} - -// IsSetFoos returns true if Foos is not nil. -func (v *QueryParamsUntaggedStruct) IsSetFoos() bool { - return v != nil && v.Foos != nil -} - type RequestWithDuplicateType struct { Request1 *BarRequest `json:"request1,omitempty"` Request2 *BarRequest `json:"request2,omitempty"` @@ -5100,6 +4492,16 @@ func _I16_EqualsPtr(lhs, rhs *int16) bool { return lhs == nil && rhs == nil } +func _I32_EqualsPtr(lhs, rhs *int32) bool { + if lhs != nil && rhs != nil { + + x := *lhs + y := *rhs + return (x == y) + } + return lhs == nil && rhs == nil +} + func _I64_EqualsPtr(lhs, rhs *int64) bool { if lhs != nil && rhs != nil { @@ -5920,15 +5322,17 @@ func (v *Bar_ArgWithManyQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithNestedQueryParams_Args represents the arguments for the Bar.argWithNestedQueryParams function. +// Bar_ArgWithNearDupQueryParams_Args represents the arguments for the Bar.argWithNearDupQueryParams function. // -// The arguments for argWithNestedQueryParams are sent and received over the wire as this struct. -type Bar_ArgWithNestedQueryParams_Args struct { - Request *QueryParamsStruct `json:"request,required"` - Opt *QueryParamsOptsStruct `json:"opt,omitempty"` +// The arguments for argWithNearDupQueryParams are sent and received over the wire as this struct. +type Bar_ArgWithNearDupQueryParams_Args struct { + One string `json:"one,required"` + Two *int32 `json:"two,omitempty"` + Three *string `json:"three,omitempty"` + Four *string `json:"four,omitempty"` } -// ToWire translates a Bar_ArgWithNestedQueryParams_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNearDupQueryParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -5943,52 +5347,53 @@ type Bar_ArgWithNestedQueryParams_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error ) - if v.Request == nil { - return w, errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") - } - w, err = v.Request.ToWire() + w, err = wire.NewValueString(v.One), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - if v.Opt != nil { - w, err = v.Opt.ToWire() + if v.Two != nil { + w, err = wire.NewValueI32(*(v.Two)), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.Three != nil { + w, err = wire.NewValueString(*(v.Three)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } + if v.Four != nil { + w, err = wire.NewValueString(*(v.Four)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _QueryParamsStruct_Read(w wire.Value) (*QueryParamsStruct, error) { - var v QueryParamsStruct - err := v.FromWire(w) - return &v, err -} - -func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { - var v QueryParamsOptsStruct - err := v.FromWire(w) - return &v, err -} - -// FromWire deserializes a Bar_ArgWithNestedQueryParams_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithNearDupQueryParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -5996,29 +5401,51 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // return nil, err // } // -// var v Bar_ArgWithNestedQueryParams_Args +// var v Bar_ArgWithNearDupQueryParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error - requestIsSet := false + oneIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TStruct { - v.Request, err = _QueryParamsStruct_Read(field.Value) + if field.Value.Type() == wire.TBinary { + v.One, err = field.Value.GetString(), error(nil) if err != nil { return err } - requestIsSet = true + oneIsSet = true } case 2: - if field.Value.Type() == wire.TStruct { - v.Opt, err = _QueryParamsOptsStruct_Read(field.Value) + if field.Value.Type() == wire.TI32 { + var x int32 + x, err = field.Value.GetI32(), error(nil) + v.Two = &x + if err != nil { + return err + } + + } + case 3: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Three = &x + if err != nil { + return err + } + + } + case 4: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Four = &x if err != nil { return err } @@ -6027,46 +5454,60 @@ func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { } } - if !requestIsSet { - return errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") + if !oneIsSet { + return errors.New("field One of Bar_ArgWithNearDupQueryParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Args +// String returns a readable string representation of a Bar_ArgWithNearDupQueryParams_Args // struct. -func (v *Bar_ArgWithNestedQueryParams_Args) String() string { +func (v *Bar_ArgWithNearDupQueryParams_Args) String() string { if v == nil { return "" } - var fields [2]string + var fields [4]string i := 0 - fields[i] = fmt.Sprintf("Request: %v", v.Request) + fields[i] = fmt.Sprintf("One: %v", v.One) i++ - if v.Opt != nil { - fields[i] = fmt.Sprintf("Opt: %v", v.Opt) + if v.Two != nil { + fields[i] = fmt.Sprintf("Two: %v", *(v.Two)) + i++ + } + if v.Three != nil { + fields[i] = fmt.Sprintf("Three: %v", *(v.Three)) + i++ + } + if v.Four != nil { + fields[i] = fmt.Sprintf("Four: %v", *(v.Four)) i++ } - return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNearDupQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Args match the -// provided Bar_ArgWithNestedQueryParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithNearDupQueryParams_Args match the +// provided Bar_ArgWithNearDupQueryParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithNestedQueryParams_Args) Equals(rhs *Bar_ArgWithNestedQueryParams_Args) bool { +func (v *Bar_ArgWithNearDupQueryParams_Args) Equals(rhs *Bar_ArgWithNearDupQueryParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !v.Request.Equals(rhs.Request) { + if !(v.One == rhs.One) { return false } - if !((v.Opt == nil && rhs.Opt == nil) || (v.Opt != nil && rhs.Opt != nil && v.Opt.Equals(rhs.Opt))) { + if !_I32_EqualsPtr(v.Two, rhs.Two) { + return false + } + if !_String_EqualsPtr(v.Three, rhs.Three) { + return false + } + if !_String_EqualsPtr(v.Four, rhs.Four) { return false } @@ -6074,134 +5515,171 @@ func (v *Bar_ArgWithNestedQueryParams_Args) Equals(rhs *Bar_ArgWithNestedQueryPa } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithNestedQueryParams_Args. -func (v *Bar_ArgWithNestedQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNearDupQueryParams_Args. +func (v *Bar_ArgWithNearDupQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - err = multierr.Append(err, enc.AddObject("request", v.Request)) - if v.Opt != nil { - err = multierr.Append(err, enc.AddObject("opt", v.Opt)) + enc.AddString("one", v.One) + if v.Two != nil { + enc.AddInt32("two", *v.Two) + } + if v.Three != nil { + enc.AddString("three", *v.Three) + } + if v.Four != nil { + enc.AddString("four", *v.Four) } return err } -// GetRequest returns the value of Request if it is set or its +// GetOne returns the value of One if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithNestedQueryParams_Args) GetRequest() (o *QueryParamsStruct) { +func (v *Bar_ArgWithNearDupQueryParams_Args) GetOne() (o string) { if v != nil { - o = v.Request + o = v.One } return } -// IsSetRequest returns true if Request is not nil. -func (v *Bar_ArgWithNestedQueryParams_Args) IsSetRequest() bool { - return v != nil && v.Request != nil +// GetTwo returns the value of Two if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithNearDupQueryParams_Args) GetTwo() (o int32) { + if v != nil && v.Two != nil { + return *v.Two + } + + return } -// GetOpt returns the value of Opt if it is set or its +// IsSetTwo returns true if Two is not nil. +func (v *Bar_ArgWithNearDupQueryParams_Args) IsSetTwo() bool { + return v != nil && v.Two != nil +} + +// GetThree returns the value of Three if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithNestedQueryParams_Args) GetOpt() (o *QueryParamsOptsStruct) { - if v != nil && v.Opt != nil { - return v.Opt +func (v *Bar_ArgWithNearDupQueryParams_Args) GetThree() (o string) { + if v != nil && v.Three != nil { + return *v.Three } return } -// IsSetOpt returns true if Opt is not nil. -func (v *Bar_ArgWithNestedQueryParams_Args) IsSetOpt() bool { - return v != nil && v.Opt != nil +// IsSetThree returns true if Three is not nil. +func (v *Bar_ArgWithNearDupQueryParams_Args) IsSetThree() bool { + return v != nil && v.Three != nil +} + +// GetFour returns the value of Four if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithNearDupQueryParams_Args) GetFour() (o string) { + if v != nil && v.Four != nil { + return *v.Four + } + + return +} + +// IsSetFour returns true if Four is not nil. +func (v *Bar_ArgWithNearDupQueryParams_Args) IsSetFour() bool { + return v != nil && v.Four != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithNestedQueryParams" for this struct. -func (v *Bar_ArgWithNestedQueryParams_Args) MethodName() string { - return "argWithNestedQueryParams" +// This will always be "argWithNearDupQueryParams" for this struct. +func (v *Bar_ArgWithNearDupQueryParams_Args) MethodName() string { + return "argWithNearDupQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithNestedQueryParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNearDupQueryParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithNestedQueryParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithNestedQueryParams +// Bar_ArgWithNearDupQueryParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithNearDupQueryParams // function. -var Bar_ArgWithNestedQueryParams_Helper = struct { - // Args accepts the parameters of argWithNestedQueryParams in-order and returns +var Bar_ArgWithNearDupQueryParams_Helper = struct { + // Args accepts the parameters of argWithNearDupQueryParams in-order and returns // the arguments struct for the function. Args func( - request *QueryParamsStruct, - opt *QueryParamsOptsStruct, - ) *Bar_ArgWithNestedQueryParams_Args + one string, + two *int32, + three *string, + four *string, + ) *Bar_ArgWithNearDupQueryParams_Args // IsException returns true if the given error can be thrown - // by argWithNestedQueryParams. + // by argWithNearDupQueryParams. // - // An error can be thrown by argWithNestedQueryParams only if the + // An error can be thrown by argWithNearDupQueryParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithNestedQueryParams + // WrapResponse returns the result struct for argWithNearDupQueryParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithNestedQueryParams into a serializable result struct. + // argWithNearDupQueryParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithNestedQueryParams + // error cannot be thrown by argWithNearDupQueryParams // - // value, err := argWithNestedQueryParams(args) - // result, err := Bar_ArgWithNestedQueryParams_Helper.WrapResponse(value, err) + // value, err := argWithNearDupQueryParams(args) + // result, err := Bar_ArgWithNearDupQueryParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithNestedQueryParams: %v", err) + // return fmt.Errorf("unexpected error from argWithNearDupQueryParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithNestedQueryParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithNearDupQueryParams_Result, error) - // UnwrapResponse takes the result struct for argWithNestedQueryParams + // UnwrapResponse takes the result struct for argWithNearDupQueryParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithNestedQueryParams threw an + // The error is non-nil only if argWithNearDupQueryParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithNestedQueryParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithNearDupQueryParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithNearDupQueryParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithNestedQueryParams_Helper.Args = func( - request *QueryParamsStruct, - opt *QueryParamsOptsStruct, - ) *Bar_ArgWithNestedQueryParams_Args { - return &Bar_ArgWithNestedQueryParams_Args{ - Request: request, - Opt: opt, + Bar_ArgWithNearDupQueryParams_Helper.Args = func( + one string, + two *int32, + three *string, + four *string, + ) *Bar_ArgWithNearDupQueryParams_Args { + return &Bar_ArgWithNearDupQueryParams_Args{ + One: one, + Two: two, + Three: three, + Four: four, } } - Bar_ArgWithNestedQueryParams_Helper.IsException = func(err error) bool { + Bar_ArgWithNearDupQueryParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithNestedQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithNestedQueryParams_Result, error) { + Bar_ArgWithNearDupQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithNearDupQueryParams_Result, error) { if err == nil { - return &Bar_ArgWithNestedQueryParams_Result{Success: success}, nil + return &Bar_ArgWithNearDupQueryParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithNestedQueryParams_Result) (success *BarResponse, err error) { + Bar_ArgWithNearDupQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithNearDupQueryParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -6214,17 +5692,17 @@ func init() { } -// Bar_ArgWithNestedQueryParams_Result represents the result of a Bar.argWithNestedQueryParams function call. +// Bar_ArgWithNearDupQueryParams_Result represents the result of a Bar.argWithNearDupQueryParams function call. // -// The result of a argWithNestedQueryParams execution is sent and received over the wire as this struct. +// The result of a argWithNearDupQueryParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithNestedQueryParams_Result struct { - // Value returned by argWithNestedQueryParams after a successful execution. +type Bar_ArgWithNearDupQueryParams_Result struct { + // Value returned by argWithNearDupQueryParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithNestedQueryParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNearDupQueryParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6239,7 +5717,7 @@ type Bar_ArgWithNestedQueryParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -6257,17 +5735,17 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithNearDupQueryParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithNestedQueryParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithNearDupQueryParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6275,12 +5753,12 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithNestedQueryParams_Result +// var v Bar_ArgWithNearDupQueryParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -6301,15 +5779,15 @@ func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithNearDupQueryParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Result +// String returns a readable string representation of a Bar_ArgWithNearDupQueryParams_Result // struct. -func (v *Bar_ArgWithNestedQueryParams_Result) String() string { +func (v *Bar_ArgWithNearDupQueryParams_Result) String() string { if v == nil { return "" } @@ -6321,14 +5799,14 @@ func (v *Bar_ArgWithNestedQueryParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNearDupQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Result match the -// provided Bar_ArgWithNestedQueryParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithNearDupQueryParams_Result match the +// provided Bar_ArgWithNearDupQueryParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithNestedQueryParams_Result) Equals(rhs *Bar_ArgWithNestedQueryParams_Result) bool { +func (v *Bar_ArgWithNearDupQueryParams_Result) Equals(rhs *Bar_ArgWithNearDupQueryParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -6342,8 +5820,8 @@ func (v *Bar_ArgWithNestedQueryParams_Result) Equals(rhs *Bar_ArgWithNestedQuery } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithNestedQueryParams_Result. -func (v *Bar_ArgWithNestedQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNearDupQueryParams_Result. +func (v *Bar_ArgWithNearDupQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -6355,7 +5833,7 @@ func (v *Bar_ArgWithNestedQueryParams_Result) MarshalLogObject(enc zapcore.Objec // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithNestedQueryParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithNearDupQueryParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -6364,34 +5842,34 @@ func (v *Bar_ArgWithNestedQueryParams_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithNestedQueryParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithNearDupQueryParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithNestedQueryParams" for this struct. -func (v *Bar_ArgWithNestedQueryParams_Result) MethodName() string { - return "argWithNestedQueryParams" +// This will always be "argWithNearDupQueryParams" for this struct. +func (v *Bar_ArgWithNearDupQueryParams_Result) MethodName() string { + return "argWithNearDupQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithNestedQueryParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNearDupQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithParams_Args represents the arguments for the Bar.argWithParams function. +// Bar_ArgWithNestedQueryParams_Args represents the arguments for the Bar.argWithNestedQueryParams function. // -// The arguments for argWithParams are sent and received over the wire as this struct. -type Bar_ArgWithParams_Args struct { - UUID string `json:"uuid,required"` - Params *ParamsStruct `json:"params,omitempty"` +// The arguments for argWithNestedQueryParams are sent and received over the wire as this struct. +type Bar_ArgWithNestedQueryParams_Args struct { + Request *QueryParamsStruct `json:"request,required"` + Opt *QueryParamsOptsStruct `json:"opt,omitempty"` } -// ToWire translates a Bar_ArgWithParams_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNestedQueryParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6406,7 +5884,7 @@ type Bar_ArgWithParams_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field i int = 0 @@ -6414,14 +5892,17 @@ func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { err error ) - w, err = wire.NewValueString(v.UUID), error(nil) + if v.Request == nil { + return w, errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") + } + w, err = v.Request.ToWire() if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - if v.Params != nil { - w, err = v.Params.ToWire() + if v.Opt != nil { + w, err = v.Opt.ToWire() if err != nil { return w, err } @@ -6432,17 +5913,23 @@ func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { - var v ParamsStruct +func _QueryParamsStruct_Read(w wire.Value) (*QueryParamsStruct, error) { + var v QueryParamsStruct err := v.FromWire(w) return &v, err } -// FromWire deserializes a Bar_ArgWithParams_Args struct from its Thrift-level +func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { + var v QueryParamsOptsStruct + err := v.FromWire(w) + return &v, err +} + +// FromWire deserializes a Bar_ArgWithNestedQueryParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6450,29 +5937,29 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // return nil, err // } // -// var v Bar_ArgWithParams_Args +// var v Bar_ArgWithNestedQueryParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error - uuidIsSet := false + requestIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TBinary { - v.UUID, err = field.Value.GetString(), error(nil) + if field.Value.Type() == wire.TStruct { + v.Request, err = _QueryParamsStruct_Read(field.Value) if err != nil { return err } - uuidIsSet = true + requestIsSet = true } case 2: if field.Value.Type() == wire.TStruct { - v.Params, err = _ParamsStruct_Read(field.Value) + v.Opt, err = _QueryParamsOptsStruct_Read(field.Value) if err != nil { return err } @@ -6481,46 +5968,46 @@ func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { } } - if !uuidIsSet { - return errors.New("field UUID of Bar_ArgWithParams_Args is required") + if !requestIsSet { + return errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithParams_Args +// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Args // struct. -func (v *Bar_ArgWithParams_Args) String() string { +func (v *Bar_ArgWithNestedQueryParams_Args) String() string { if v == nil { return "" } var fields [2]string i := 0 - fields[i] = fmt.Sprintf("UUID: %v", v.UUID) + fields[i] = fmt.Sprintf("Request: %v", v.Request) i++ - if v.Params != nil { - fields[i] = fmt.Sprintf("Params: %v", v.Params) + if v.Opt != nil { + fields[i] = fmt.Sprintf("Opt: %v", v.Opt) i++ } - return fmt.Sprintf("Bar_ArgWithParams_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParams_Args match the -// provided Bar_ArgWithParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Args match the +// provided Bar_ArgWithNestedQueryParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithParams_Args) Equals(rhs *Bar_ArgWithParams_Args) bool { +func (v *Bar_ArgWithNestedQueryParams_Args) Equals(rhs *Bar_ArgWithNestedQueryParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !(v.UUID == rhs.UUID) { + if !v.Request.Equals(rhs.Request) { return false } - if !((v.Params == nil && rhs.Params == nil) || (v.Params != nil && rhs.Params != nil && v.Params.Equals(rhs.Params))) { + if !((v.Opt == nil && rhs.Opt == nil) || (v.Opt != nil && rhs.Opt != nil && v.Opt.Equals(rhs.Opt))) { return false } @@ -6528,129 +6015,134 @@ func (v *Bar_ArgWithParams_Args) Equals(rhs *Bar_ArgWithParams_Args) bool { } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParams_Args. -func (v *Bar_ArgWithParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNestedQueryParams_Args. +func (v *Bar_ArgWithNestedQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - enc.AddString("uuid", v.UUID) - if v.Params != nil { - err = multierr.Append(err, enc.AddObject("params", v.Params)) + err = multierr.Append(err, enc.AddObject("request", v.Request)) + if v.Opt != nil { + err = multierr.Append(err, enc.AddObject("opt", v.Opt)) } return err } -// GetUUID returns the value of UUID if it is set or its +// GetRequest returns the value of Request if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParams_Args) GetUUID() (o string) { +func (v *Bar_ArgWithNestedQueryParams_Args) GetRequest() (o *QueryParamsStruct) { if v != nil { - o = v.UUID + o = v.Request } return } -// GetParams returns the value of Params if it is set or its +// IsSetRequest returns true if Request is not nil. +func (v *Bar_ArgWithNestedQueryParams_Args) IsSetRequest() bool { + return v != nil && v.Request != nil +} + +// GetOpt returns the value of Opt if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParams_Args) GetParams() (o *ParamsStruct) { - if v != nil && v.Params != nil { - return v.Params +func (v *Bar_ArgWithNestedQueryParams_Args) GetOpt() (o *QueryParamsOptsStruct) { + if v != nil && v.Opt != nil { + return v.Opt } return } -// IsSetParams returns true if Params is not nil. -func (v *Bar_ArgWithParams_Args) IsSetParams() bool { - return v != nil && v.Params != nil +// IsSetOpt returns true if Opt is not nil. +func (v *Bar_ArgWithNestedQueryParams_Args) IsSetOpt() bool { + return v != nil && v.Opt != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithParams" for this struct. -func (v *Bar_ArgWithParams_Args) MethodName() string { - return "argWithParams" +// This will always be "argWithNestedQueryParams" for this struct. +func (v *Bar_ArgWithNestedQueryParams_Args) MethodName() string { + return "argWithNestedQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNestedQueryParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithParams +// Bar_ArgWithNestedQueryParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithNestedQueryParams // function. -var Bar_ArgWithParams_Helper = struct { - // Args accepts the parameters of argWithParams in-order and returns +var Bar_ArgWithNestedQueryParams_Helper = struct { + // Args accepts the parameters of argWithNestedQueryParams in-order and returns // the arguments struct for the function. Args func( - uuid string, - params *ParamsStruct, - ) *Bar_ArgWithParams_Args + request *QueryParamsStruct, + opt *QueryParamsOptsStruct, + ) *Bar_ArgWithNestedQueryParams_Args // IsException returns true if the given error can be thrown - // by argWithParams. + // by argWithNestedQueryParams. // - // An error can be thrown by argWithParams only if the + // An error can be thrown by argWithNestedQueryParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithParams + // WrapResponse returns the result struct for argWithNestedQueryParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithParams into a serializable result struct. + // argWithNestedQueryParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithParams + // error cannot be thrown by argWithNestedQueryParams // - // value, err := argWithParams(args) - // result, err := Bar_ArgWithParams_Helper.WrapResponse(value, err) + // value, err := argWithNestedQueryParams(args) + // result, err := Bar_ArgWithNestedQueryParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithParams: %v", err) + // return fmt.Errorf("unexpected error from argWithNestedQueryParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithNestedQueryParams_Result, error) - // UnwrapResponse takes the result struct for argWithParams + // UnwrapResponse takes the result struct for argWithNestedQueryParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithParams threw an + // The error is non-nil only if argWithNestedQueryParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithNestedQueryParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithParams_Helper.Args = func( - uuid string, - params *ParamsStruct, - ) *Bar_ArgWithParams_Args { - return &Bar_ArgWithParams_Args{ - UUID: uuid, - Params: params, + Bar_ArgWithNestedQueryParams_Helper.Args = func( + request *QueryParamsStruct, + opt *QueryParamsOptsStruct, + ) *Bar_ArgWithNestedQueryParams_Args { + return &Bar_ArgWithNestedQueryParams_Args{ + Request: request, + Opt: opt, } } - Bar_ArgWithParams_Helper.IsException = func(err error) bool { + Bar_ArgWithNestedQueryParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParams_Result, error) { + Bar_ArgWithNestedQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithNestedQueryParams_Result, error) { if err == nil { - return &Bar_ArgWithParams_Result{Success: success}, nil + return &Bar_ArgWithNestedQueryParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithParams_Helper.UnwrapResponse = func(result *Bar_ArgWithParams_Result) (success *BarResponse, err error) { + Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithNestedQueryParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -6663,17 +6155,17 @@ func init() { } -// Bar_ArgWithParams_Result represents the result of a Bar.argWithParams function call. +// Bar_ArgWithNestedQueryParams_Result represents the result of a Bar.argWithNestedQueryParams function call. // -// The result of a argWithParams execution is sent and received over the wire as this struct. +// The result of a argWithNestedQueryParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithParams_Result struct { - // Value returned by argWithParams after a successful execution. +type Bar_ArgWithNestedQueryParams_Result struct { + // Value returned by argWithNestedQueryParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNestedQueryParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6688,7 +6180,7 @@ type Bar_ArgWithParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -6706,17 +6198,17 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithNestedQueryParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6724,12 +6216,12 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithParams_Result +// var v Bar_ArgWithNestedQueryParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -6750,15 +6242,15 @@ func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithParams_Result +// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Result // struct. -func (v *Bar_ArgWithParams_Result) String() string { +func (v *Bar_ArgWithNestedQueryParams_Result) String() string { if v == nil { return "" } @@ -6770,14 +6262,14 @@ func (v *Bar_ArgWithParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParams_Result match the -// provided Bar_ArgWithParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Result match the +// provided Bar_ArgWithNestedQueryParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithParams_Result) Equals(rhs *Bar_ArgWithParams_Result) bool { +func (v *Bar_ArgWithNestedQueryParams_Result) Equals(rhs *Bar_ArgWithNestedQueryParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -6791,8 +6283,8 @@ func (v *Bar_ArgWithParams_Result) Equals(rhs *Bar_ArgWithParams_Result) bool { } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParams_Result. -func (v *Bar_ArgWithParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNestedQueryParams_Result. +func (v *Bar_ArgWithNestedQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -6804,7 +6296,7 @@ func (v *Bar_ArgWithParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) ( // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithNestedQueryParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -6813,34 +6305,34 @@ func (v *Bar_ArgWithParams_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithNestedQueryParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithParams" for this struct. -func (v *Bar_ArgWithParams_Result) MethodName() string { - return "argWithParams" +// This will always be "argWithNestedQueryParams" for this struct. +func (v *Bar_ArgWithNestedQueryParams_Result) MethodName() string { + return "argWithNestedQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNestedQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithParamsAndDuplicateFields_Args represents the arguments for the Bar.argWithParamsAndDuplicateFields function. +// Bar_ArgWithParams_Args represents the arguments for the Bar.argWithParams function. // -// The arguments for argWithParamsAndDuplicateFields are sent and received over the wire as this struct. -type Bar_ArgWithParamsAndDuplicateFields_Args struct { - Request *RequestWithDuplicateType `json:"request,required"` - EntityUUID string `json:"entityUUID,required"` +// The arguments for argWithParams are sent and received over the wire as this struct. +type Bar_ArgWithParams_Args struct { + UUID string `json:"uuid,required"` + Params *ParamsStruct `json:"params,omitempty"` } -// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6855,7 +6347,7 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field i int = 0 @@ -6863,37 +6355,35 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) err error ) - if v.Request == nil { - return w, errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") - } - w, err = v.Request.ToWire() + w, err = wire.NewValueString(v.UUID), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - - w, err = wire.NewValueString(v.EntityUUID), error(nil) - if err != nil { - return w, err + if v.Params != nil { + w, err = v.Params.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 2, Value: w} + i++ } - fields[i] = wire.Field{ID: 2, Value: w} - i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, error) { - var v RequestWithDuplicateType +func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { + var v ParamsStruct err := v.FromWire(w) return &v, err } -// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct +// An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6901,80 +6391,77 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // return nil, err // } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args +// var v Bar_ArgWithParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error - requestIsSet := false - entityUUIDIsSet := false + uuidIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TStruct { - v.Request, err = _RequestWithDuplicateType_Read(field.Value) + if field.Value.Type() == wire.TBinary { + v.UUID, err = field.Value.GetString(), error(nil) if err != nil { return err } - requestIsSet = true + uuidIsSet = true } case 2: - if field.Value.Type() == wire.TBinary { - v.EntityUUID, err = field.Value.GetString(), error(nil) + if field.Value.Type() == wire.TStruct { + v.Params, err = _ParamsStruct_Read(field.Value) if err != nil { return err } - entityUUIDIsSet = true + } } } - if !requestIsSet { - return errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") - } - - if !entityUUIDIsSet { - return errors.New("field EntityUUID of Bar_ArgWithParamsAndDuplicateFields_Args is required") + if !uuidIsSet { + return errors.New("field UUID of Bar_ArgWithParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Args +// String returns a readable string representation of a Bar_ArgWithParams_Args // struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) String() string { +func (v *Bar_ArgWithParams_Args) String() string { if v == nil { return "" } var fields [2]string i := 0 - fields[i] = fmt.Sprintf("Request: %v", v.Request) - i++ - fields[i] = fmt.Sprintf("EntityUUID: %v", v.EntityUUID) + fields[i] = fmt.Sprintf("UUID: %v", v.UUID) i++ + if v.Params != nil { + fields[i] = fmt.Sprintf("Params: %v", v.Params) + i++ + } - return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParams_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Args match the -// provided Bar_ArgWithParamsAndDuplicateFields_Args. +// Equals returns true if all the fields of this Bar_ArgWithParams_Args match the +// provided Bar_ArgWithParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Args) bool { +func (v *Bar_ArgWithParams_Args) Equals(rhs *Bar_ArgWithParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !v.Request.Equals(rhs.Request) { + if !(v.UUID == rhs.UUID) { return false } - if !(v.EntityUUID == rhs.EntityUUID) { + if !((v.Params == nil && rhs.Params == nil) || (v.Params != nil && rhs.Params != nil && v.Params.Equals(rhs.Params))) { return false } @@ -6982,126 +6469,129 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Args) Equals(rhs *Bar_ArgWithParams } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParamsAndDuplicateFields_Args. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParams_Args. +func (v *Bar_ArgWithParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - err = multierr.Append(err, enc.AddObject("request", v.Request)) - enc.AddString("entityUUID", v.EntityUUID) + enc.AddString("uuid", v.UUID) + if v.Params != nil { + err = multierr.Append(err, enc.AddObject("params", v.Params)) + } return err } -// GetRequest returns the value of Request if it is set or its +// GetUUID returns the value of UUID if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetRequest() (o *RequestWithDuplicateType) { +func (v *Bar_ArgWithParams_Args) GetUUID() (o string) { if v != nil { - o = v.Request + o = v.UUID } return } -// IsSetRequest returns true if Request is not nil. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) IsSetRequest() bool { - return v != nil && v.Request != nil -} - -// GetEntityUUID returns the value of EntityUUID if it is set or its +// GetParams returns the value of Params if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetEntityUUID() (o string) { - if v != nil { - o = v.EntityUUID +func (v *Bar_ArgWithParams_Args) GetParams() (o *ParamsStruct) { + if v != nil && v.Params != nil { + return v.Params } + return } +// IsSetParams returns true if Params is not nil. +func (v *Bar_ArgWithParams_Args) IsSetParams() bool { + return v != nil && v.Params != nil +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithParamsAndDuplicateFields" for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MethodName() string { - return "argWithParamsAndDuplicateFields" +// This will always be "argWithParams" for this struct. +func (v *Bar_ArgWithParams_Args) MethodName() string { + return "argWithParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithParamsAndDuplicateFields_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithParamsAndDuplicateFields +// Bar_ArgWithParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithParams // function. -var Bar_ArgWithParamsAndDuplicateFields_Helper = struct { - // Args accepts the parameters of argWithParamsAndDuplicateFields in-order and returns +var Bar_ArgWithParams_Helper = struct { + // Args accepts the parameters of argWithParams in-order and returns // the arguments struct for the function. Args func( - request *RequestWithDuplicateType, - entityUUID string, - ) *Bar_ArgWithParamsAndDuplicateFields_Args + uuid string, + params *ParamsStruct, + ) *Bar_ArgWithParams_Args // IsException returns true if the given error can be thrown - // by argWithParamsAndDuplicateFields. + // by argWithParams. // - // An error can be thrown by argWithParamsAndDuplicateFields only if the + // An error can be thrown by argWithParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithParamsAndDuplicateFields + // WrapResponse returns the result struct for argWithParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithParamsAndDuplicateFields into a serializable result struct. + // argWithParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithParamsAndDuplicateFields + // error cannot be thrown by argWithParams // - // value, err := argWithParamsAndDuplicateFields(args) - // result, err := Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse(value, err) + // value, err := argWithParams(args) + // result, err := Bar_ArgWithParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithParamsAndDuplicateFields: %v", err) + // return fmt.Errorf("unexpected error from argWithParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithParams_Result, error) - // UnwrapResponse takes the result struct for argWithParamsAndDuplicateFields + // UnwrapResponse takes the result struct for argWithParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithParamsAndDuplicateFields threw an + // The error is non-nil only if argWithParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithParamsAndDuplicateFields_Result) (*BarResponse, error) + // value, err := Bar_ArgWithParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithParamsAndDuplicateFields_Helper.Args = func( - request *RequestWithDuplicateType, - entityUUID string, - ) *Bar_ArgWithParamsAndDuplicateFields_Args { - return &Bar_ArgWithParamsAndDuplicateFields_Args{ - Request: request, - EntityUUID: entityUUID, + Bar_ArgWithParams_Helper.Args = func( + uuid string, + params *ParamsStruct, + ) *Bar_ArgWithParams_Args { + return &Bar_ArgWithParams_Args{ + UUID: uuid, + Params: params, } } - Bar_ArgWithParamsAndDuplicateFields_Helper.IsException = func(err error) bool { + Bar_ArgWithParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) { + Bar_ArgWithParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParams_Result, error) { if err == nil { - return &Bar_ArgWithParamsAndDuplicateFields_Result{Success: success}, nil + return &Bar_ArgWithParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse = func(result *Bar_ArgWithParamsAndDuplicateFields_Result) (success *BarResponse, err error) { + Bar_ArgWithParams_Helper.UnwrapResponse = func(result *Bar_ArgWithParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -7114,17 +6604,17 @@ func init() { } -// Bar_ArgWithParamsAndDuplicateFields_Result represents the result of a Bar.argWithParamsAndDuplicateFields function call. +// Bar_ArgWithParams_Result represents the result of a Bar.argWithParams function call. // -// The result of a argWithParamsAndDuplicateFields execution is sent and received over the wire as this struct. +// The result of a argWithParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithParamsAndDuplicateFields_Result struct { - // Value returned by argWithParamsAndDuplicateFields after a successful execution. +type Bar_ArgWithParams_Result struct { + // Value returned by argWithParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7139,7 +6629,7 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -7157,17 +6647,17 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct +// An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7175,12 +6665,12 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // return nil, err // } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result +// var v Bar_ArgWithParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -7201,15 +6691,15 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) erro count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Result +// String returns a readable string representation of a Bar_ArgWithParams_Result // struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) String() string { +func (v *Bar_ArgWithParams_Result) String() string { if v == nil { return "" } @@ -7221,14 +6711,14 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Result match the -// provided Bar_ArgWithParamsAndDuplicateFields_Result. +// Equals returns true if all the fields of this Bar_ArgWithParams_Result match the +// provided Bar_ArgWithParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Result) bool { +func (v *Bar_ArgWithParams_Result) Equals(rhs *Bar_ArgWithParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -7242,8 +6732,8 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) Equals(rhs *Bar_ArgWithPara } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParamsAndDuplicateFields_Result. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParams_Result. +func (v *Bar_ArgWithParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -7255,7 +6745,7 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MarshalLogObject(enc zapcor // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -7264,33 +6754,34 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) GetSuccess() (o *BarRespons } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithParamsAndDuplicateFields" for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MethodName() string { - return "argWithParamsAndDuplicateFields" +// This will always be "argWithParams" for this struct. +func (v *Bar_ArgWithParams_Result) MethodName() string { + return "argWithParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithQueryHeader_Args represents the arguments for the Bar.argWithQueryHeader function. +// Bar_ArgWithParamsAndDuplicateFields_Args represents the arguments for the Bar.argWithParamsAndDuplicateFields function. // -// The arguments for argWithQueryHeader are sent and received over the wire as this struct. -type Bar_ArgWithQueryHeader_Args struct { - UserUUID *string `json:"userUUID,omitempty"` +// The arguments for argWithParamsAndDuplicateFields are sent and received over the wire as this struct. +type Bar_ArgWithParamsAndDuplicateFields_Args struct { + Request *RequestWithDuplicateType `json:"request,required"` + EntityUUID string `json:"entityUUID,required"` } -// ToWire translates a Bar_ArgWithQueryHeader_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7305,31 +6796,45 @@ type Bar_ArgWithQueryHeader_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( - fields [1]wire.Field + fields [2]wire.Field i int = 0 w wire.Value err error ) - if v.UserUUID != nil { - w, err = wire.NewValueString(*(v.UserUUID)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ + if v.Request == nil { + return w, errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") + } + w, err = v.Request.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 1, Value: w} + i++ + + w, err = wire.NewValueString(v.EntityUUID), error(nil) + if err != nil { + return w, err } + fields[i] = wire.Field{ID: 2, Value: w} + i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithQueryHeader_Args struct from its Thrift-level +func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, error) { + var v RequestWithDuplicateType + err := v.FromWire(w) + return &v, err +} + +// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct +// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7337,60 +6842,80 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithQueryHeader_Args +// var v Bar_ArgWithParamsAndDuplicateFields_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error + requestIsSet := false + entityUUIDIsSet := false + for _, field := range w.GetStruct().Fields { switch field.ID { case 1: + if field.Value.Type() == wire.TStruct { + v.Request, err = _RequestWithDuplicateType_Read(field.Value) + if err != nil { + return err + } + requestIsSet = true + } + case 2: if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.UserUUID = &x + v.EntityUUID, err = field.Value.GetString(), error(nil) if err != nil { return err } - + entityUUIDIsSet = true } } } + if !requestIsSet { + return errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") + } + + if !entityUUIDIsSet { + return errors.New("field EntityUUID of Bar_ArgWithParamsAndDuplicateFields_Args is required") + } + return nil } -// String returns a readable string representation of a Bar_ArgWithQueryHeader_Args +// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Args // struct. -func (v *Bar_ArgWithQueryHeader_Args) String() string { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) String() string { if v == nil { return "" } - var fields [1]string + var fields [2]string i := 0 - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } + fields[i] = fmt.Sprintf("Request: %v", v.Request) + i++ + fields[i] = fmt.Sprintf("EntityUUID: %v", v.EntityUUID) + i++ - return fmt.Sprintf("Bar_ArgWithQueryHeader_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Args match the -// provided Bar_ArgWithQueryHeader_Args. +// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Args match the +// provided Bar_ArgWithParamsAndDuplicateFields_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryHeader_Args) Equals(rhs *Bar_ArgWithQueryHeader_Args) bool { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { + if !v.Request.Equals(rhs.Request) { + return false + } + if !(v.EntityUUID == rhs.EntityUUID) { return false } @@ -7398,116 +6923,126 @@ func (v *Bar_ArgWithQueryHeader_Args) Equals(rhs *Bar_ArgWithQueryHeader_Args) b } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryHeader_Args. -func (v *Bar_ArgWithQueryHeader_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParamsAndDuplicateFields_Args. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - if v.UserUUID != nil { - enc.AddString("userUUID", *v.UserUUID) - } + err = multierr.Append(err, enc.AddObject("request", v.Request)) + enc.AddString("entityUUID", v.EntityUUID) return err } -// GetUserUUID returns the value of UserUUID if it is set or its +// GetRequest returns the value of Request if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryHeader_Args) GetUserUUID() (o string) { - if v != nil && v.UserUUID != nil { - return *v.UserUUID +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetRequest() (o *RequestWithDuplicateType) { + if v != nil { + o = v.Request } - return } -// IsSetUserUUID returns true if UserUUID is not nil. -func (v *Bar_ArgWithQueryHeader_Args) IsSetUserUUID() bool { - return v != nil && v.UserUUID != nil +// IsSetRequest returns true if Request is not nil. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) IsSetRequest() bool { + return v != nil && v.Request != nil +} + +// GetEntityUUID returns the value of EntityUUID if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetEntityUUID() (o string) { + if v != nil { + o = v.EntityUUID + } + return } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithQueryHeader" for this struct. -func (v *Bar_ArgWithQueryHeader_Args) MethodName() string { - return "argWithQueryHeader" +// This will always be "argWithParamsAndDuplicateFields" for this struct. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MethodName() string { + return "argWithParamsAndDuplicateFields" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithQueryHeader_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithQueryHeader_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithQueryHeader +// Bar_ArgWithParamsAndDuplicateFields_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithParamsAndDuplicateFields // function. -var Bar_ArgWithQueryHeader_Helper = struct { - // Args accepts the parameters of argWithQueryHeader in-order and returns +var Bar_ArgWithParamsAndDuplicateFields_Helper = struct { + // Args accepts the parameters of argWithParamsAndDuplicateFields in-order and returns // the arguments struct for the function. Args func( - userUUID *string, - ) *Bar_ArgWithQueryHeader_Args + request *RequestWithDuplicateType, + entityUUID string, + ) *Bar_ArgWithParamsAndDuplicateFields_Args // IsException returns true if the given error can be thrown - // by argWithQueryHeader. + // by argWithParamsAndDuplicateFields. // - // An error can be thrown by argWithQueryHeader only if the + // An error can be thrown by argWithParamsAndDuplicateFields only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithQueryHeader + // WrapResponse returns the result struct for argWithParamsAndDuplicateFields // given its return value and error. // // This allows mapping values and errors returned by - // argWithQueryHeader into a serializable result struct. + // argWithParamsAndDuplicateFields into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithQueryHeader + // error cannot be thrown by argWithParamsAndDuplicateFields // - // value, err := argWithQueryHeader(args) - // result, err := Bar_ArgWithQueryHeader_Helper.WrapResponse(value, err) + // value, err := argWithParamsAndDuplicateFields(args) + // result, err := Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithQueryHeader: %v", err) + // return fmt.Errorf("unexpected error from argWithParamsAndDuplicateFields: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryHeader_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) - // UnwrapResponse takes the result struct for argWithQueryHeader + // UnwrapResponse takes the result struct for argWithParamsAndDuplicateFields // and returns the value or error returned by it. // - // The error is non-nil only if argWithQueryHeader threw an + // The error is non-nil only if argWithParamsAndDuplicateFields threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithQueryHeader_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithQueryHeader_Result) (*BarResponse, error) + // value, err := Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithParamsAndDuplicateFields_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithQueryHeader_Helper.Args = func( - userUUID *string, - ) *Bar_ArgWithQueryHeader_Args { - return &Bar_ArgWithQueryHeader_Args{ - UserUUID: userUUID, + Bar_ArgWithParamsAndDuplicateFields_Helper.Args = func( + request *RequestWithDuplicateType, + entityUUID string, + ) *Bar_ArgWithParamsAndDuplicateFields_Args { + return &Bar_ArgWithParamsAndDuplicateFields_Args{ + Request: request, + EntityUUID: entityUUID, } } - Bar_ArgWithQueryHeader_Helper.IsException = func(err error) bool { + Bar_ArgWithParamsAndDuplicateFields_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithQueryHeader_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryHeader_Result, error) { + Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) { if err == nil { - return &Bar_ArgWithQueryHeader_Result{Success: success}, nil + return &Bar_ArgWithParamsAndDuplicateFields_Result{Success: success}, nil } return nil, err } - Bar_ArgWithQueryHeader_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryHeader_Result) (success *BarResponse, err error) { + Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse = func(result *Bar_ArgWithParamsAndDuplicateFields_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -7520,17 +7055,17 @@ func init() { } -// Bar_ArgWithQueryHeader_Result represents the result of a Bar.argWithQueryHeader function call. +// Bar_ArgWithParamsAndDuplicateFields_Result represents the result of a Bar.argWithParamsAndDuplicateFields function call. // -// The result of a argWithQueryHeader execution is sent and received over the wire as this struct. +// The result of a argWithParamsAndDuplicateFields execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithQueryHeader_Result struct { - // Value returned by argWithQueryHeader after a successful execution. +type Bar_ArgWithParamsAndDuplicateFields_Result struct { + // Value returned by argWithParamsAndDuplicateFields after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithQueryHeader_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7545,7 +7080,7 @@ type Bar_ArgWithQueryHeader_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -7563,17 +7098,17 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithQueryHeader_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct +// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7581,12 +7116,12 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithQueryHeader_Result +// var v Bar_ArgWithParamsAndDuplicateFields_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -7607,15 +7142,15 @@ func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithQueryHeader_Result +// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Result // struct. -func (v *Bar_ArgWithQueryHeader_Result) String() string { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) String() string { if v == nil { return "" } @@ -7627,14 +7162,14 @@ func (v *Bar_ArgWithQueryHeader_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithQueryHeader_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Result match the -// provided Bar_ArgWithQueryHeader_Result. +// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Result match the +// provided Bar_ArgWithParamsAndDuplicateFields_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryHeader_Result) Equals(rhs *Bar_ArgWithQueryHeader_Result) bool { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -7648,8 +7183,8 @@ func (v *Bar_ArgWithQueryHeader_Result) Equals(rhs *Bar_ArgWithQueryHeader_Resul } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryHeader_Result. -func (v *Bar_ArgWithQueryHeader_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParamsAndDuplicateFields_Result. +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -7661,7 +7196,7 @@ func (v *Bar_ArgWithQueryHeader_Result) MarshalLogObject(enc zapcore.ObjectEncod // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryHeader_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -7670,62 +7205,33 @@ func (v *Bar_ArgWithQueryHeader_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithQueryHeader_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithQueryHeader" for this struct. -func (v *Bar_ArgWithQueryHeader_Result) MethodName() string { - return "argWithQueryHeader" +// This will always be "argWithParamsAndDuplicateFields" for this struct. +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MethodName() string { + return "argWithParamsAndDuplicateFields" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithQueryHeader_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithQueryParams_Args represents the arguments for the Bar.argWithQueryParams function. +// Bar_ArgWithQueryHeader_Args represents the arguments for the Bar.argWithQueryHeader function. // -// The arguments for argWithQueryParams are sent and received over the wire as this struct. -type Bar_ArgWithQueryParams_Args struct { - Name string `json:"name,required"` - UserUUID *string `json:"userUUID,omitempty"` - Foo []string `json:"foo,omitempty"` - Bar []int8 `json:"bar,required"` -} - -type _List_Byte_ValueList []int8 - -func (v _List_Byte_ValueList) ForEach(f func(wire.Value) error) error { - for _, x := range v { - w, err := wire.NewValueI8(x), error(nil) - if err != nil { - return err - } - err = f(w) - if err != nil { - return err - } - } - return nil -} - -func (v _List_Byte_ValueList) Size() int { - return len(v) -} - -func (_List_Byte_ValueList) ValueType() wire.Type { - return wire.TI8 +// The arguments for argWithQueryHeader are sent and received over the wire as this struct. +type Bar_ArgWithQueryHeader_Args struct { + UserUUID *string `json:"userUUID,omitempty"` } -func (_List_Byte_ValueList) Close() {} - -// ToWire translates a Bar_ArgWithQueryParams_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithQueryHeader_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7740,72 +7246,31 @@ func (_List_Byte_ValueList) Close() {} // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( - fields [4]wire.Field + fields [1]wire.Field i int = 0 w wire.Value err error ) - w, err = wire.NewValueString(v.Name), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ if v.UserUUID != nil { w, err = wire.NewValueString(*(v.UserUUID)), error(nil) if err != nil { return w, err } - fields[i] = wire.Field{ID: 2, Value: w} - i++ - } - if v.Foo != nil { - w, err = wire.NewValueList(_List_String_ValueList(v.Foo)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 3, Value: w} + fields[i] = wire.Field{ID: 1, Value: w} i++ } - if v.Bar == nil { - return w, errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") - } - w, err = wire.NewValueList(_List_Byte_ValueList(v.Bar)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 4, Value: w} - i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _List_Byte_Read(l wire.ValueList) ([]int8, error) { - if l.ValueType() != wire.TI8 { - return nil, nil - } - - o := make([]int8, 0, l.Size()) - err := l.ForEach(func(x wire.Value) error { - i, err := x.GetI8(), error(nil) - if err != nil { - return err - } - o = append(o, i) - return nil - }) - l.Close() - return o, err -} - -// FromWire deserializes a Bar_ArgWithQueryParams_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryHeader_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7813,29 +7278,17 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // return nil, err // } // -// var v Bar_ArgWithQueryParams_Args +// var v Bar_ArgWithQueryHeader_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error - nameIsSet := false - - barIsSet := false - for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TBinary { - v.Name, err = field.Value.GetString(), error(nil) - if err != nil { - return err - } - nameIsSet = true - } - case 2: if field.Value.Type() == wire.TBinary { var x string x, err = field.Value.GetString(), error(nil) @@ -7845,142 +7298,61 @@ func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { } } - case 3: - if field.Value.Type() == wire.TList { - v.Foo, err = _List_String_Read(field.Value.GetList()) - if err != nil { - return err - } - - } - case 4: - if field.Value.Type() == wire.TList { - v.Bar, err = _List_Byte_Read(field.Value.GetList()) - if err != nil { - return err - } - barIsSet = true - } } } - if !nameIsSet { - return errors.New("field Name of Bar_ArgWithQueryParams_Args is required") - } - - if !barIsSet { - return errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") - } - return nil } -// String returns a readable string representation of a Bar_ArgWithQueryParams_Args +// String returns a readable string representation of a Bar_ArgWithQueryHeader_Args // struct. -func (v *Bar_ArgWithQueryParams_Args) String() string { +func (v *Bar_ArgWithQueryHeader_Args) String() string { if v == nil { return "" } - - var fields [4]string - i := 0 - fields[i] = fmt.Sprintf("Name: %v", v.Name) - i++ - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } - if v.Foo != nil { - fields[i] = fmt.Sprintf("Foo: %v", v.Foo) - i++ - } - fields[i] = fmt.Sprintf("Bar: %v", v.Bar) - i++ - - return fmt.Sprintf("Bar_ArgWithQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) -} - -func _List_Byte_Equals(lhs, rhs []int8) bool { - if len(lhs) != len(rhs) { - return false - } - - for i, lv := range lhs { - rv := rhs[i] - if !(lv == rv) { - return false - } + + var fields [1]string + i := 0 + if v.UserUUID != nil { + fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) + i++ } - return true + return fmt.Sprintf("Bar_ArgWithQueryHeader_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Args match the -// provided Bar_ArgWithQueryParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Args match the +// provided Bar_ArgWithQueryHeader_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryParams_Args) Equals(rhs *Bar_ArgWithQueryParams_Args) bool { +func (v *Bar_ArgWithQueryHeader_Args) Equals(rhs *Bar_ArgWithQueryHeader_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !(v.Name == rhs.Name) { - return false - } if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { return false } - if !((v.Foo == nil && rhs.Foo == nil) || (v.Foo != nil && rhs.Foo != nil && _List_String_Equals(v.Foo, rhs.Foo))) { - return false - } - if !_List_Byte_Equals(v.Bar, rhs.Bar) { - return false - } return true } -type _List_Byte_Zapper []int8 - -// MarshalLogArray implements zapcore.ArrayMarshaler, enabling -// fast logging of _List_Byte_Zapper. -func (l _List_Byte_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) { - for _, v := range l { - enc.AppendInt8(v) - } - return err -} - // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryParams_Args. -func (v *Bar_ArgWithQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryHeader_Args. +func (v *Bar_ArgWithQueryHeader_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - enc.AddString("name", v.Name) if v.UserUUID != nil { enc.AddString("userUUID", *v.UserUUID) } - if v.Foo != nil { - err = multierr.Append(err, enc.AddArray("foo", (_List_String_Zapper)(v.Foo))) - } - err = multierr.Append(err, enc.AddArray("bar", (_List_Byte_Zapper)(v.Bar))) return err } -// GetName returns the value of Name if it is set or its -// zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetName() (o string) { - if v != nil { - o = v.Name - } - return -} - // GetUserUUID returns the value of UserUUID if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetUserUUID() (o string) { +func (v *Bar_ArgWithQueryHeader_Args) GetUserUUID() (o string) { if v != nil && v.UserUUID != nil { return *v.UserUUID } @@ -7989,132 +7361,94 @@ func (v *Bar_ArgWithQueryParams_Args) GetUserUUID() (o string) { } // IsSetUserUUID returns true if UserUUID is not nil. -func (v *Bar_ArgWithQueryParams_Args) IsSetUserUUID() bool { +func (v *Bar_ArgWithQueryHeader_Args) IsSetUserUUID() bool { return v != nil && v.UserUUID != nil } -// GetFoo returns the value of Foo if it is set or its -// zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetFoo() (o []string) { - if v != nil && v.Foo != nil { - return v.Foo - } - - return -} - -// IsSetFoo returns true if Foo is not nil. -func (v *Bar_ArgWithQueryParams_Args) IsSetFoo() bool { - return v != nil && v.Foo != nil -} - -// GetBar returns the value of Bar if it is set or its -// zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetBar() (o []int8) { - if v != nil { - o = v.Bar - } - return -} - -// IsSetBar returns true if Bar is not nil. -func (v *Bar_ArgWithQueryParams_Args) IsSetBar() bool { - return v != nil && v.Bar != nil -} - // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithQueryParams" for this struct. -func (v *Bar_ArgWithQueryParams_Args) MethodName() string { - return "argWithQueryParams" +// This will always be "argWithQueryHeader" for this struct. +func (v *Bar_ArgWithQueryHeader_Args) MethodName() string { + return "argWithQueryHeader" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithQueryParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryHeader_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithQueryParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithQueryParams +// Bar_ArgWithQueryHeader_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithQueryHeader // function. -var Bar_ArgWithQueryParams_Helper = struct { - // Args accepts the parameters of argWithQueryParams in-order and returns +var Bar_ArgWithQueryHeader_Helper = struct { + // Args accepts the parameters of argWithQueryHeader in-order and returns // the arguments struct for the function. Args func( - name string, userUUID *string, - foo []string, - bar []int8, - ) *Bar_ArgWithQueryParams_Args + ) *Bar_ArgWithQueryHeader_Args // IsException returns true if the given error can be thrown - // by argWithQueryParams. + // by argWithQueryHeader. // - // An error can be thrown by argWithQueryParams only if the + // An error can be thrown by argWithQueryHeader only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithQueryParams + // WrapResponse returns the result struct for argWithQueryHeader // given its return value and error. // // This allows mapping values and errors returned by - // argWithQueryParams into a serializable result struct. + // argWithQueryHeader into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithQueryParams + // error cannot be thrown by argWithQueryHeader // - // value, err := argWithQueryParams(args) - // result, err := Bar_ArgWithQueryParams_Helper.WrapResponse(value, err) + // value, err := argWithQueryHeader(args) + // result, err := Bar_ArgWithQueryHeader_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithQueryParams: %v", err) + // return fmt.Errorf("unexpected error from argWithQueryHeader: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryHeader_Result, error) - // UnwrapResponse takes the result struct for argWithQueryParams + // UnwrapResponse takes the result struct for argWithQueryHeader // and returns the value or error returned by it. // - // The error is non-nil only if argWithQueryParams threw an + // The error is non-nil only if argWithQueryHeader threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithQueryParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithQueryParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithQueryHeader_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithQueryHeader_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithQueryParams_Helper.Args = func( - name string, + Bar_ArgWithQueryHeader_Helper.Args = func( userUUID *string, - foo []string, - bar []int8, - ) *Bar_ArgWithQueryParams_Args { - return &Bar_ArgWithQueryParams_Args{ - Name: name, + ) *Bar_ArgWithQueryHeader_Args { + return &Bar_ArgWithQueryHeader_Args{ UserUUID: userUUID, - Foo: foo, - Bar: bar, } } - Bar_ArgWithQueryParams_Helper.IsException = func(err error) bool { + Bar_ArgWithQueryHeader_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryParams_Result, error) { + Bar_ArgWithQueryHeader_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryHeader_Result, error) { if err == nil { - return &Bar_ArgWithQueryParams_Result{Success: success}, nil + return &Bar_ArgWithQueryHeader_Result{Success: success}, nil } return nil, err } - Bar_ArgWithQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryParams_Result) (success *BarResponse, err error) { + Bar_ArgWithQueryHeader_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryHeader_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -8127,17 +7461,17 @@ func init() { } -// Bar_ArgWithQueryParams_Result represents the result of a Bar.argWithQueryParams function call. +// Bar_ArgWithQueryHeader_Result represents the result of a Bar.argWithQueryHeader function call. // -// The result of a argWithQueryParams execution is sent and received over the wire as this struct. +// The result of a argWithQueryHeader execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithQueryParams_Result struct { - // Value returned by argWithQueryParams after a successful execution. +type Bar_ArgWithQueryHeader_Result struct { + // Value returned by argWithQueryHeader after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithQueryParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithQueryHeader_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -8152,7 +7486,7 @@ type Bar_ArgWithQueryParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -8170,17 +7504,17 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithQueryParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryHeader_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -8188,12 +7522,12 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithQueryParams_Result +// var v Bar_ArgWithQueryHeader_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -8214,15 +7548,15 @@ func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithQueryParams_Result +// String returns a readable string representation of a Bar_ArgWithQueryHeader_Result // struct. -func (v *Bar_ArgWithQueryParams_Result) String() string { +func (v *Bar_ArgWithQueryHeader_Result) String() string { if v == nil { return "" } @@ -8234,14 +7568,14 @@ func (v *Bar_ArgWithQueryParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithQueryHeader_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Result match the -// provided Bar_ArgWithQueryParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Result match the +// provided Bar_ArgWithQueryHeader_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryParams_Result) Equals(rhs *Bar_ArgWithQueryParams_Result) bool { +func (v *Bar_ArgWithQueryHeader_Result) Equals(rhs *Bar_ArgWithQueryHeader_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -8255,8 +7589,8 @@ func (v *Bar_ArgWithQueryParams_Result) Equals(rhs *Bar_ArgWithQueryParams_Resul } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryParams_Result. -func (v *Bar_ArgWithQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryHeader_Result. +func (v *Bar_ArgWithQueryHeader_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -8268,7 +7602,7 @@ func (v *Bar_ArgWithQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncod // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithQueryHeader_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -8277,34 +7611,62 @@ func (v *Bar_ArgWithQueryParams_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithQueryParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithQueryHeader_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithQueryParams" for this struct. -func (v *Bar_ArgWithQueryParams_Result) MethodName() string { - return "argWithQueryParams" +// This will always be "argWithQueryHeader" for this struct. +func (v *Bar_ArgWithQueryHeader_Result) MethodName() string { + return "argWithQueryHeader" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithQueryParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryHeader_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithUntaggedNestedQueryParams_Args represents the arguments for the Bar.argWithUntaggedNestedQueryParams function. +// Bar_ArgWithQueryParams_Args represents the arguments for the Bar.argWithQueryParams function. // -// The arguments for argWithUntaggedNestedQueryParams are sent and received over the wire as this struct. -type Bar_ArgWithUntaggedNestedQueryParams_Args struct { - Request *QueryParamsUntaggedStruct `json:"request,required"` - Opt *QueryParamsUntaggedOptStruct `json:"opt,omitempty"` +// The arguments for argWithQueryParams are sent and received over the wire as this struct. +type Bar_ArgWithQueryParams_Args struct { + Name string `json:"name,required"` + UserUUID *string `json:"userUUID,omitempty"` + Foo []string `json:"foo,omitempty"` + Bar []int8 `json:"bar,required"` +} + +type _List_Byte_ValueList []int8 + +func (v _List_Byte_ValueList) ForEach(f func(wire.Value) error) error { + for _, x := range v { + w, err := wire.NewValueI8(x), error(nil) + if err != nil { + return err + } + err = f(w) + if err != nil { + return err + } + } + return nil +} + +func (v _List_Byte_ValueList) Size() int { + return len(v) +} + +func (_List_Byte_ValueList) ValueType() wire.Type { + return wire.TI8 } -// ToWire translates a Bar_ArgWithUntaggedNestedQueryParams_Args struct into a Thrift-level intermediate +func (_List_Byte_ValueList) Close() {} + +// ToWire translates a Bar_ArgWithQueryParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -8319,52 +7681,72 @@ type Bar_ArgWithUntaggedNestedQueryParams_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error ) - if v.Request == nil { - return w, errors.New("field Request of Bar_ArgWithUntaggedNestedQueryParams_Args is required") - } - w, err = v.Request.ToWire() + w, err = wire.NewValueString(v.Name), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - if v.Opt != nil { - w, err = v.Opt.ToWire() + if v.UserUUID != nil { + w, err = wire.NewValueString(*(v.UserUUID)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 2, Value: w} + i++ + } + if v.Foo != nil { + w, err = wire.NewValueList(_List_String_ValueList(v.Foo)), error(nil) if err != nil { return w, err } - fields[i] = wire.Field{ID: 2, Value: w} + fields[i] = wire.Field{ID: 3, Value: w} i++ } + if v.Bar == nil { + return w, errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") + } + w, err = wire.NewValueList(_List_Byte_ValueList(v.Bar)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _QueryParamsUntaggedStruct_Read(w wire.Value) (*QueryParamsUntaggedStruct, error) { - var v QueryParamsUntaggedStruct - err := v.FromWire(w) - return &v, err -} +func _List_Byte_Read(l wire.ValueList) ([]int8, error) { + if l.ValueType() != wire.TI8 { + return nil, nil + } -func _QueryParamsUntaggedOptStruct_Read(w wire.Value) (*QueryParamsUntaggedOptStruct, error) { - var v QueryParamsUntaggedOptStruct - err := v.FromWire(w) - return &v, err + o := make([]int8, 0, l.Size()) + err := l.ForEach(func(x wire.Value) error { + i, err := x.GetI8(), error(nil) + if err != nil { + return err + } + o = append(o, i) + return nil + }) + l.Close() + return o, err } -// FromWire deserializes a Bar_ArgWithUntaggedNestedQueryParams_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithUntaggedNestedQueryParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -8372,212 +7754,308 @@ func _QueryParamsUntaggedOptStruct_Read(w wire.Value) (*QueryParamsUntaggedOptSt // return nil, err // } // -// var v Bar_ArgWithUntaggedNestedQueryParams_Args +// var v Bar_ArgWithQueryParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error - requestIsSet := false + nameIsSet := false + + barIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TStruct { - v.Request, err = _QueryParamsUntaggedStruct_Read(field.Value) + if field.Value.Type() == wire.TBinary { + v.Name, err = field.Value.GetString(), error(nil) if err != nil { return err } - requestIsSet = true + nameIsSet = true } case 2: - if field.Value.Type() == wire.TStruct { - v.Opt, err = _QueryParamsUntaggedOptStruct_Read(field.Value) + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.UserUUID = &x + if err != nil { + return err + } + + } + case 3: + if field.Value.Type() == wire.TList { + v.Foo, err = _List_String_Read(field.Value.GetList()) if err != nil { return err } } + case 4: + if field.Value.Type() == wire.TList { + v.Bar, err = _List_Byte_Read(field.Value.GetList()) + if err != nil { + return err + } + barIsSet = true + } } } - if !requestIsSet { - return errors.New("field Request of Bar_ArgWithUntaggedNestedQueryParams_Args is required") + if !nameIsSet { + return errors.New("field Name of Bar_ArgWithQueryParams_Args is required") + } + + if !barIsSet { + return errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithUntaggedNestedQueryParams_Args +// String returns a readable string representation of a Bar_ArgWithQueryParams_Args // struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) String() string { +func (v *Bar_ArgWithQueryParams_Args) String() string { if v == nil { return "" } - var fields [2]string + var fields [4]string i := 0 - fields[i] = fmt.Sprintf("Request: %v", v.Request) + fields[i] = fmt.Sprintf("Name: %v", v.Name) i++ - if v.Opt != nil { - fields[i] = fmt.Sprintf("Opt: %v", v.Opt) + if v.UserUUID != nil { + fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) + i++ + } + if v.Foo != nil { + fields[i] = fmt.Sprintf("Foo: %v", v.Foo) i++ } + fields[i] = fmt.Sprintf("Bar: %v", v.Bar) + i++ + + return fmt.Sprintf("Bar_ArgWithQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) +} + +func _List_Byte_Equals(lhs, rhs []int8) bool { + if len(lhs) != len(rhs) { + return false + } + + for i, lv := range lhs { + rv := rhs[i] + if !(lv == rv) { + return false + } + } - return fmt.Sprintf("Bar_ArgWithUntaggedNestedQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) + return true } -// Equals returns true if all the fields of this Bar_ArgWithUntaggedNestedQueryParams_Args match the -// provided Bar_ArgWithUntaggedNestedQueryParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Args match the +// provided Bar_ArgWithQueryParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) Equals(rhs *Bar_ArgWithUntaggedNestedQueryParams_Args) bool { +func (v *Bar_ArgWithQueryParams_Args) Equals(rhs *Bar_ArgWithQueryParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !v.Request.Equals(rhs.Request) { + if !(v.Name == rhs.Name) { return false } - if !((v.Opt == nil && rhs.Opt == nil) || (v.Opt != nil && rhs.Opt != nil && v.Opt.Equals(rhs.Opt))) { + if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { + return false + } + if !((v.Foo == nil && rhs.Foo == nil) || (v.Foo != nil && rhs.Foo != nil && _List_String_Equals(v.Foo, rhs.Foo))) { + return false + } + if !_List_Byte_Equals(v.Bar, rhs.Bar) { return false } return true } +type _List_Byte_Zapper []int8 + +// MarshalLogArray implements zapcore.ArrayMarshaler, enabling +// fast logging of _List_Byte_Zapper. +func (l _List_Byte_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) { + for _, v := range l { + enc.AppendInt8(v) + } + return err +} + // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithUntaggedNestedQueryParams_Args. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryParams_Args. +func (v *Bar_ArgWithQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - err = multierr.Append(err, enc.AddObject("request", v.Request)) - if v.Opt != nil { - err = multierr.Append(err, enc.AddObject("opt", v.Opt)) + enc.AddString("name", v.Name) + if v.UserUUID != nil { + enc.AddString("userUUID", *v.UserUUID) + } + if v.Foo != nil { + err = multierr.Append(err, enc.AddArray("foo", (_List_String_Zapper)(v.Foo))) } + err = multierr.Append(err, enc.AddArray("bar", (_List_Byte_Zapper)(v.Bar))) return err } -// GetRequest returns the value of Request if it is set or its +// GetName returns the value of Name if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) GetRequest() (o *QueryParamsUntaggedStruct) { +func (v *Bar_ArgWithQueryParams_Args) GetName() (o string) { if v != nil { - o = v.Request + o = v.Name } return } -// IsSetRequest returns true if Request is not nil. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) IsSetRequest() bool { - return v != nil && v.Request != nil +// GetUserUUID returns the value of UserUUID if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithQueryParams_Args) GetUserUUID() (o string) { + if v != nil && v.UserUUID != nil { + return *v.UserUUID + } + + return } -// GetOpt returns the value of Opt if it is set or its +// IsSetUserUUID returns true if UserUUID is not nil. +func (v *Bar_ArgWithQueryParams_Args) IsSetUserUUID() bool { + return v != nil && v.UserUUID != nil +} + +// GetFoo returns the value of Foo if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) GetOpt() (o *QueryParamsUntaggedOptStruct) { - if v != nil && v.Opt != nil { - return v.Opt +func (v *Bar_ArgWithQueryParams_Args) GetFoo() (o []string) { + if v != nil && v.Foo != nil { + return v.Foo } return } -// IsSetOpt returns true if Opt is not nil. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) IsSetOpt() bool { - return v != nil && v.Opt != nil +// IsSetFoo returns true if Foo is not nil. +func (v *Bar_ArgWithQueryParams_Args) IsSetFoo() bool { + return v != nil && v.Foo != nil +} + +// GetBar returns the value of Bar if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithQueryParams_Args) GetBar() (o []int8) { + if v != nil { + o = v.Bar + } + return +} + +// IsSetBar returns true if Bar is not nil. +func (v *Bar_ArgWithQueryParams_Args) IsSetBar() bool { + return v != nil && v.Bar != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithUntaggedNestedQueryParams" for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) MethodName() string { - return "argWithUntaggedNestedQueryParams" +// This will always be "argWithQueryParams" for this struct. +func (v *Bar_ArgWithQueryParams_Args) MethodName() string { + return "argWithQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithUntaggedNestedQueryParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithUntaggedNestedQueryParams +// Bar_ArgWithQueryParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithQueryParams // function. -var Bar_ArgWithUntaggedNestedQueryParams_Helper = struct { - // Args accepts the parameters of argWithUntaggedNestedQueryParams in-order and returns +var Bar_ArgWithQueryParams_Helper = struct { + // Args accepts the parameters of argWithQueryParams in-order and returns // the arguments struct for the function. Args func( - request *QueryParamsUntaggedStruct, - opt *QueryParamsUntaggedOptStruct, - ) *Bar_ArgWithUntaggedNestedQueryParams_Args + name string, + userUUID *string, + foo []string, + bar []int8, + ) *Bar_ArgWithQueryParams_Args // IsException returns true if the given error can be thrown - // by argWithUntaggedNestedQueryParams. + // by argWithQueryParams. // - // An error can be thrown by argWithUntaggedNestedQueryParams only if the + // An error can be thrown by argWithQueryParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithUntaggedNestedQueryParams + // WrapResponse returns the result struct for argWithQueryParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithUntaggedNestedQueryParams into a serializable result struct. + // argWithQueryParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithUntaggedNestedQueryParams + // error cannot be thrown by argWithQueryParams // - // value, err := argWithUntaggedNestedQueryParams(args) - // result, err := Bar_ArgWithUntaggedNestedQueryParams_Helper.WrapResponse(value, err) + // value, err := argWithQueryParams(args) + // result, err := Bar_ArgWithQueryParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithUntaggedNestedQueryParams: %v", err) + // return fmt.Errorf("unexpected error from argWithQueryParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithUntaggedNestedQueryParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryParams_Result, error) - // UnwrapResponse takes the result struct for argWithUntaggedNestedQueryParams + // UnwrapResponse takes the result struct for argWithQueryParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithUntaggedNestedQueryParams threw an + // The error is non-nil only if argWithQueryParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithUntaggedNestedQueryParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithUntaggedNestedQueryParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithQueryParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithQueryParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithUntaggedNestedQueryParams_Helper.Args = func( - request *QueryParamsUntaggedStruct, - opt *QueryParamsUntaggedOptStruct, - ) *Bar_ArgWithUntaggedNestedQueryParams_Args { - return &Bar_ArgWithUntaggedNestedQueryParams_Args{ - Request: request, - Opt: opt, + Bar_ArgWithQueryParams_Helper.Args = func( + name string, + userUUID *string, + foo []string, + bar []int8, + ) *Bar_ArgWithQueryParams_Args { + return &Bar_ArgWithQueryParams_Args{ + Name: name, + UserUUID: userUUID, + Foo: foo, + Bar: bar, } } - Bar_ArgWithUntaggedNestedQueryParams_Helper.IsException = func(err error) bool { + Bar_ArgWithQueryParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithUntaggedNestedQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithUntaggedNestedQueryParams_Result, error) { + Bar_ArgWithQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryParams_Result, error) { if err == nil { - return &Bar_ArgWithUntaggedNestedQueryParams_Result{Success: success}, nil + return &Bar_ArgWithQueryParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithUntaggedNestedQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithUntaggedNestedQueryParams_Result) (success *BarResponse, err error) { + Bar_ArgWithQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -8590,17 +8068,17 @@ func init() { } -// Bar_ArgWithUntaggedNestedQueryParams_Result represents the result of a Bar.argWithUntaggedNestedQueryParams function call. +// Bar_ArgWithQueryParams_Result represents the result of a Bar.argWithQueryParams function call. // -// The result of a argWithUntaggedNestedQueryParams execution is sent and received over the wire as this struct. +// The result of a argWithQueryParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithUntaggedNestedQueryParams_Result struct { - // Value returned by argWithUntaggedNestedQueryParams after a successful execution. +type Bar_ArgWithQueryParams_Result struct { + // Value returned by argWithQueryParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithUntaggedNestedQueryParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithQueryParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -8615,7 +8093,7 @@ type Bar_ArgWithUntaggedNestedQueryParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -8633,17 +8111,17 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) ToWire() (wire.Value, erro } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithUntaggedNestedQueryParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithUntaggedNestedQueryParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithUntaggedNestedQueryParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -8651,12 +8129,12 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) ToWire() (wire.Value, erro // return nil, err // } // -// var v Bar_ArgWithUntaggedNestedQueryParams_Result +// var v Bar_ArgWithQueryParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -8677,15 +8155,15 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) FromWire(w wire.Value) err count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithUntaggedNestedQueryParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithUntaggedNestedQueryParams_Result +// String returns a readable string representation of a Bar_ArgWithQueryParams_Result // struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) String() string { +func (v *Bar_ArgWithQueryParams_Result) String() string { if v == nil { return "" } @@ -8697,14 +8175,14 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithUntaggedNestedQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithUntaggedNestedQueryParams_Result match the -// provided Bar_ArgWithUntaggedNestedQueryParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Result match the +// provided Bar_ArgWithQueryParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) Equals(rhs *Bar_ArgWithUntaggedNestedQueryParams_Result) bool { +func (v *Bar_ArgWithQueryParams_Result) Equals(rhs *Bar_ArgWithQueryParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -8718,8 +8196,8 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) Equals(rhs *Bar_ArgWithUnt } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithUntaggedNestedQueryParams_Result. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryParams_Result. +func (v *Bar_ArgWithQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -8731,7 +8209,7 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalLogObject(enc zapco // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithQueryParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -8740,22 +8218,22 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) GetSuccess() (o *BarRespon } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithQueryParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithUntaggedNestedQueryParams" for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) MethodName() string { - return "argWithUntaggedNestedQueryParams" +// This will always be "argWithQueryParams" for this struct. +func (v *Bar_ArgWithQueryParams_Result) MethodName() string { + return "argWithQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } diff --git a/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go b/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go index 299029a92..dbed10a7a 100644 --- a/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go +++ b/examples/example-gateway/build/gen-code/clients/bar/bar/bar_easyjson.go @@ -1,6 +1,6 @@ // Code generated by zanzibar // @generated -// Checksum : b5X7Uh5iRP/sgSQXJo5GFQ== +// Checksum : 4rpr9GjYF0b4FXDqCrTxgA== // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package bar @@ -313,371 +313,7 @@ func (v *RequestWithDuplicateType) UnmarshalJSON(data []byte) error { func (v *RequestWithDuplicateType) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(in *jlexer.Lexer, out *QueryParamsUntaggedStruct) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - var NameSet bool - var CountSet bool - var FoosSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "name": - out.Name = string(in.String()) - NameSet = true - case "userUUID": - if in.IsNull() { - in.Skip() - out.UserUUID = nil - } else { - if out.UserUUID == nil { - out.UserUUID = new(string) - } - *out.UserUUID = string(in.String()) - } - case "count": - out.Count = int32(in.Int32()) - CountSet = true - case "optCount": - if in.IsNull() { - in.Skip() - out.OptCount = nil - } else { - if out.OptCount == nil { - out.OptCount = new(int32) - } - *out.OptCount = int32(in.Int32()) - } - case "foos": - if in.IsNull() { - in.Skip() - out.Foos = nil - } else { - in.Delim('[') - if out.Foos == nil { - if !in.IsDelim(']') { - out.Foos = make([]string, 0, 4) - } else { - out.Foos = []string{} - } - } else { - out.Foos = (out.Foos)[:0] - } - for !in.IsDelim(']') { - var v1 string - v1 = string(in.String()) - out.Foos = append(out.Foos, v1) - in.WantComma() - } - in.Delim(']') - } - FoosSet = true - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } - if !NameSet { - in.AddError(fmt.Errorf("key 'name' is required")) - } - if !CountSet { - in.AddError(fmt.Errorf("key 'count' is required")) - } - if !FoosSet { - in.AddError(fmt.Errorf("key 'foos' is required")) - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(out *jwriter.Writer, in QueryParamsUntaggedStruct) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"name\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Name)) - } - if in.UserUUID != nil { - const prefix string = ",\"userUUID\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(*in.UserUUID)) - } - { - const prefix string = ",\"count\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(in.Count)) - } - if in.OptCount != nil { - const prefix string = ",\"optCount\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(*in.OptCount)) - } - { - const prefix string = ",\"foos\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - if in.Foos == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { - out.RawString("null") - } else { - out.RawByte('[') - for v2, v3 := range in.Foos { - if v2 > 0 { - out.RawByte(',') - } - out.String(string(v3)) - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v QueryParamsUntaggedStruct) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v QueryParamsUntaggedStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *QueryParamsUntaggedStruct) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *QueryParamsUntaggedStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(in *jlexer.Lexer, out *QueryParamsUntaggedOptStruct) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - var NameSet bool - var CountSet bool - var FoosSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "name": - out.Name = string(in.String()) - NameSet = true - case "userUUID": - if in.IsNull() { - in.Skip() - out.UserUUID = nil - } else { - if out.UserUUID == nil { - out.UserUUID = new(string) - } - *out.UserUUID = string(in.String()) - } - case "count": - out.Count = int32(in.Int32()) - CountSet = true - case "optCount": - if in.IsNull() { - in.Skip() - out.OptCount = nil - } else { - if out.OptCount == nil { - out.OptCount = new(int32) - } - *out.OptCount = int32(in.Int32()) - } - case "foos": - if in.IsNull() { - in.Skip() - out.Foos = nil - } else { - in.Delim('[') - if out.Foos == nil { - if !in.IsDelim(']') { - out.Foos = make([]string, 0, 4) - } else { - out.Foos = []string{} - } - } else { - out.Foos = (out.Foos)[:0] - } - for !in.IsDelim(']') { - var v4 string - v4 = string(in.String()) - out.Foos = append(out.Foos, v4) - in.WantComma() - } - in.Delim(']') - } - FoosSet = true - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } - if !NameSet { - in.AddError(fmt.Errorf("key 'name' is required")) - } - if !CountSet { - in.AddError(fmt.Errorf("key 'count' is required")) - } - if !FoosSet { - in.AddError(fmt.Errorf("key 'foos' is required")) - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(out *jwriter.Writer, in QueryParamsUntaggedOptStruct) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"name\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Name)) - } - if in.UserUUID != nil { - const prefix string = ",\"userUUID\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(*in.UserUUID)) - } - { - const prefix string = ",\"count\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(in.Count)) - } - if in.OptCount != nil { - const prefix string = ",\"optCount\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(*in.OptCount)) - } - { - const prefix string = ",\"foos\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - if in.Foos == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { - out.RawString("null") - } else { - out.RawByte('[') - for v5, v6 := range in.Foos { - if v5 > 0 { - out.RawByte(',') - } - out.String(string(v6)) - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v QueryParamsUntaggedOptStruct) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v QueryParamsUntaggedOptStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *QueryParamsUntaggedOptStruct) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *QueryParamsUntaggedOptStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(in *jlexer.Lexer, out *QueryParamsStruct) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(in *jlexer.Lexer, out *QueryParamsStruct) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -747,9 +383,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Foo = (out.Foo)[:0] } for !in.IsDelim(']') { - var v7 string - v7 = string(in.String()) - out.Foo = append(out.Foo, v7) + var v1 string + v1 = string(in.String()) + out.Foo = append(out.Foo, v1) in.WantComma() } in.Delim(']') @@ -771,7 +407,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'foo' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(out *jwriter.Writer, in QueryParamsStruct) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(out *jwriter.Writer, in QueryParamsStruct) { out.RawByte('{') first := true _ = first @@ -827,11 +463,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v8, v9 := range in.Foo { - if v8 > 0 { + for v2, v3 := range in.Foo { + if v2 > 0 { out.RawByte(',') } - out.String(string(v9)) + out.String(string(v3)) } out.RawByte(']') } @@ -842,27 +478,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v QueryParamsStruct) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v QueryParamsStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *QueryParamsStruct) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *QueryParamsStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar1(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(in *jlexer.Lexer, out *QueryParamsOptsStruct) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(in *jlexer.Lexer, out *QueryParamsOptsStruct) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -928,7 +564,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'name' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(out *jwriter.Writer, in QueryParamsOptsStruct) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(out *jwriter.Writer, in QueryParamsOptsStruct) { out.RawByte('{') first := true _ = first @@ -978,27 +614,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v QueryParamsOptsStruct) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v QueryParamsOptsStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *QueryParamsOptsStruct) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *QueryParamsOptsStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar2(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(in *jlexer.Lexer, out *ParamsStruct) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(in *jlexer.Lexer, out *ParamsStruct) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1034,7 +670,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'userUUID' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(out *jwriter.Writer, in ParamsStruct) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(out *jwriter.Writer, in ParamsStruct) { out.RawByte('{') first := true _ = first @@ -1054,25 +690,25 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v ParamsStruct) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ParamsStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ParamsStruct) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ParamsStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar3(l, v) } func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarEchoEchoTypedef(in *jlexer.Lexer, out *Echo_EchoTypedef_Result) { isTopLevel := in.IsStart() @@ -1264,17 +900,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Success = (out.Success)[:0] } for !in.IsDelim(']') { - var v10 *BarResponse + var v4 *BarResponse if in.IsNull() { in.Skip() - v10 = nil + v4 = nil } else { - if v10 == nil { - v10 = new(BarResponse) + if v4 == nil { + v4 = new(BarResponse) } - (*v10).UnmarshalEasyJSON(in) + (*v4).UnmarshalEasyJSON(in) } - out.Success = append(out.Success, v10) + out.Success = append(out.Success, v4) in.WantComma() } in.Delim(']') @@ -1303,14 +939,14 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v11, v12 := range in.Success { - if v11 > 0 { + for v5, v6 := range in.Success { + if v5 > 0 { out.RawByte(',') } - if v12 == nil { + if v6 == nil { out.RawString("null") } else { - (*v12).MarshalEasyJSON(out) + (*v6).MarshalEasyJSON(out) } } out.RawByte(']') @@ -1378,17 +1014,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Arg = (out.Arg)[:0] } for !in.IsDelim(']') { - var v13 *BarResponse + var v7 *BarResponse if in.IsNull() { in.Skip() - v13 = nil + v7 = nil } else { - if v13 == nil { - v13 = new(BarResponse) + if v7 == nil { + v7 = new(BarResponse) } - (*v13).UnmarshalEasyJSON(in) + (*v7).UnmarshalEasyJSON(in) } - out.Arg = append(out.Arg, v13) + out.Arg = append(out.Arg, v7) in.WantComma() } in.Delim(']') @@ -1423,14 +1059,14 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v14, v15 := range in.Arg { - if v14 > 0 { + for v8, v9 := range in.Arg { + if v8 > 0 { out.RawByte(',') } - if v15 == nil { + if v9 == nil { out.RawString("null") } else { - (*v15).MarshalEasyJSON(out) + (*v9).MarshalEasyJSON(out) } } out.RawByte(']') @@ -1503,12 +1139,12 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Success = (out.Success)[:0] } for !in.IsDelim(']') { - var v16 struct { + var v10 struct { Key *BarResponse Value string } - easyjson4347b5c1Decode(in, &v16) - out.Success = append(out.Success, v16) + easyjson4347b5c1Decode(in, &v10) + out.Success = append(out.Success, v10) in.WantComma() } in.Delim(']') @@ -1537,11 +1173,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v17, v18 := range in.Success { - if v17 > 0 { + for v11, v12 := range in.Success { + if v11 > 0 { out.RawByte(',') } - easyjson4347b5c1Encode(out, v18) + easyjson4347b5c1Encode(out, v12) } out.RawByte(']') } @@ -1691,12 +1327,12 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Arg = (out.Arg)[:0] } for !in.IsDelim(']') { - var v19 struct { + var v13 struct { Key *BarResponse Value string } - easyjson4347b5c1Decode(in, &v19) - out.Arg = append(out.Arg, v19) + easyjson4347b5c1Decode(in, &v13) + out.Arg = append(out.Arg, v13) in.WantComma() } in.Delim(']') @@ -1731,11 +1367,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v20, v21 := range in.Arg { - if v20 > 0 { + for v14, v15 := range in.Arg { + if v14 > 0 { out.RawByte(',') } - easyjson4347b5c1Encode(out, v21) + easyjson4347b5c1Encode(out, v15) } out.RawByte(']') } @@ -1801,17 +1437,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Success = (out.Success)[:0] } for !in.IsDelim(']') { - var v22 *BarResponse + var v16 *BarResponse if in.IsNull() { in.Skip() - v22 = nil + v16 = nil } else { - if v22 == nil { - v22 = new(BarResponse) + if v16 == nil { + v16 = new(BarResponse) } - (*v22).UnmarshalEasyJSON(in) + (*v16).UnmarshalEasyJSON(in) } - out.Success = append(out.Success, v22) + out.Success = append(out.Success, v16) in.WantComma() } in.Delim(']') @@ -1840,14 +1476,14 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v23, v24 := range in.Success { - if v23 > 0 { + for v17, v18 := range in.Success { + if v17 > 0 { out.RawByte(',') } - if v24 == nil { + if v18 == nil { out.RawString("null") } else { - (*v24).MarshalEasyJSON(out) + (*v18).MarshalEasyJSON(out) } } out.RawByte(']') @@ -1915,17 +1551,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Arg = (out.Arg)[:0] } for !in.IsDelim(']') { - var v25 *BarResponse + var v19 *BarResponse if in.IsNull() { in.Skip() - v25 = nil + v19 = nil } else { - if v25 == nil { - v25 = new(BarResponse) + if v19 == nil { + v19 = new(BarResponse) } - (*v25).UnmarshalEasyJSON(in) + (*v19).UnmarshalEasyJSON(in) } - out.Arg = append(out.Arg, v25) + out.Arg = append(out.Arg, v19) in.WantComma() } in.Delim(']') @@ -1960,14 +1596,14 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v26, v27 := range in.Arg { - if v26 > 0 { + for v20, v21 := range in.Arg { + if v20 > 0 { out.RawByte(',') } - if v27 == nil { + if v21 == nil { out.RawString("null") } else { - (*v27).MarshalEasyJSON(out) + (*v21).MarshalEasyJSON(out) } } out.RawByte(']') @@ -2186,9 +1822,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v28 struct{} - easyjson4347b5c1Decode1(in, &v28) - (out.Success)[key] = v28 + var v22 struct{} + easyjson4347b5c1Decode1(in, &v22) + (out.Success)[key] = v22 in.WantComma() } in.Delim('}') @@ -2217,16 +1853,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('{') - v29First := true - for v29Name, v29Value := range in.Success { - if v29First { - v29First = false + v23First := true + for v23Name, v23Value := range in.Success { + if v23First { + v23First = false } else { out.RawByte(',') } - out.String(string(v29Name)) + out.String(string(v23Name)) out.RawByte(':') - easyjson4347b5c1Encode1(out, v29Value) + easyjson4347b5c1Encode1(out, v23Value) } out.RawByte('}') } @@ -2325,9 +1961,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v30 struct{} - easyjson4347b5c1Decode1(in, &v30) - (out.Arg)[key] = v30 + var v24 struct{} + easyjson4347b5c1Decode1(in, &v24) + (out.Arg)[key] = v24 in.WantComma() } in.Delim('}') @@ -2362,16 +1998,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v31First := true - for v31Name, v31Value := range in.Arg { - if v31First { - v31First = false + v25First := true + for v25Name, v25Value := range in.Arg { + if v25First { + v25First = false } else { out.RawByte(',') } - out.String(string(v31Name)) + out.String(string(v25Name)) out.RawByte(':') - easyjson4347b5c1Encode1(out, v31Value) + easyjson4347b5c1Encode1(out, v25Value) } out.RawByte('}') } @@ -2434,17 +2070,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v32 *BarResponse + var v26 *BarResponse if in.IsNull() { in.Skip() - v32 = nil + v26 = nil } else { - if v32 == nil { - v32 = new(BarResponse) + if v26 == nil { + v26 = new(BarResponse) } - (*v32).UnmarshalEasyJSON(in) + (*v26).UnmarshalEasyJSON(in) } - (out.Success)[key] = v32 + (out.Success)[key] = v26 in.WantComma() } in.Delim('}') @@ -2473,19 +2109,19 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('{') - v33First := true - for v33Name, v33Value := range in.Success { - if v33First { - v33First = false + v27First := true + for v27Name, v27Value := range in.Success { + if v27First { + v27First = false } else { out.RawByte(',') } - out.String(string(v33Name)) + out.String(string(v27Name)) out.RawByte(':') - if v33Value == nil { + if v27Value == nil { out.RawString("null") } else { - (*v33Value).MarshalEasyJSON(out) + (*v27Value).MarshalEasyJSON(out) } } out.RawByte('}') @@ -2550,17 +2186,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v34 *BarResponse + var v28 *BarResponse if in.IsNull() { in.Skip() - v34 = nil + v28 = nil } else { - if v34 == nil { - v34 = new(BarResponse) + if v28 == nil { + v28 = new(BarResponse) } - (*v34).UnmarshalEasyJSON(in) + (*v28).UnmarshalEasyJSON(in) } - (out.Arg)[key] = v34 + (out.Arg)[key] = v28 in.WantComma() } in.Delim('}') @@ -2595,19 +2231,19 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v35First := true - for v35Name, v35Value := range in.Arg { - if v35First { - v35First = false + v29First := true + for v29Name, v29Value := range in.Arg { + if v29First { + v29First = false } else { out.RawByte(',') } - out.String(string(v35Name)) + out.String(string(v29Name)) out.RawByte(':') - if v35Value == nil { + if v29Value == nil { out.RawString("null") } else { - (*v35Value).MarshalEasyJSON(out) + (*v29Value).MarshalEasyJSON(out) } } out.RawByte('}') @@ -2674,9 +2310,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Success = (out.Success)[:0] } for !in.IsDelim(']') { - var v36 string - v36 = string(in.String()) - out.Success = append(out.Success, v36) + var v30 string + v30 = string(in.String()) + out.Success = append(out.Success, v30) in.WantComma() } in.Delim(']') @@ -2705,11 +2341,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v37, v38 := range in.Success { - if v37 > 0 { + for v31, v32 := range in.Success { + if v31 > 0 { out.RawByte(',') } - out.String(string(v38)) + out.String(string(v32)) } out.RawByte(']') } @@ -2776,9 +2412,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Arg = (out.Arg)[:0] } for !in.IsDelim(']') { - var v39 string - v39 = string(in.String()) - out.Arg = append(out.Arg, v39) + var v33 string + v33 = string(in.String()) + out.Arg = append(out.Arg, v33) in.WantComma() } in.Delim(']') @@ -2813,11 +2449,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v40, v41 := range in.Arg { - if v40 > 0 { + for v34, v35 := range in.Arg { + if v34 > 0 { out.RawByte(',') } - out.String(string(v41)) + out.String(string(v35)) } out.RawByte(']') } @@ -3345,17 +2981,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := int32(in.Int32Str()) in.WantColon() - var v42 *BarResponse + var v36 *BarResponse if in.IsNull() { in.Skip() - v42 = nil + v36 = nil } else { - if v42 == nil { - v42 = new(BarResponse) + if v36 == nil { + v36 = new(BarResponse) } - (*v42).UnmarshalEasyJSON(in) + (*v36).UnmarshalEasyJSON(in) } - (out.Success)[key] = v42 + (out.Success)[key] = v36 in.WantComma() } in.Delim('}') @@ -3384,19 +3020,19 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('{') - v43First := true - for v43Name, v43Value := range in.Success { - if v43First { - v43First = false + v37First := true + for v37Name, v37Value := range in.Success { + if v37First { + v37First = false } else { out.RawByte(',') } - out.Int32Str(int32(v43Name)) + out.Int32Str(int32(v37Name)) out.RawByte(':') - if v43Value == nil { + if v37Value == nil { out.RawString("null") } else { - (*v43Value).MarshalEasyJSON(out) + (*v37Value).MarshalEasyJSON(out) } } out.RawByte('}') @@ -3461,17 +3097,17 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := int32(in.Int32Str()) in.WantColon() - var v44 *BarResponse + var v38 *BarResponse if in.IsNull() { in.Skip() - v44 = nil + v38 = nil } else { - if v44 == nil { - v44 = new(BarResponse) + if v38 == nil { + v38 = new(BarResponse) } - (*v44).UnmarshalEasyJSON(in) + (*v38).UnmarshalEasyJSON(in) } - (out.Arg)[key] = v44 + (out.Arg)[key] = v38 in.WantComma() } in.Delim('}') @@ -3506,19 +3142,19 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v45First := true - for v45Name, v45Value := range in.Arg { - if v45First { - v45First = false + v39First := true + for v39Name, v39Value := range in.Arg { + if v39First { + v39First = false } else { out.RawByte(',') } - out.Int32Str(int32(v45Name)) + out.Int32Str(int32(v39Name)) out.RawByte(':') - if v45Value == nil { + if v39Value == nil { out.RawString("null") } else { - (*v45Value).MarshalEasyJSON(out) + (*v39Value).MarshalEasyJSON(out) } } out.RawByte('}') @@ -4689,9 +4325,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v52 string - v52 = string(in.String()) - (out.FooMap)[key] = v52 + var v46 string + v46 = string(in.String()) + (out.FooMap)[key] = v46 in.WantComma() } in.Delim('}') @@ -4783,16 +4419,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('{') - v53First := true - for v53Name, v53Value := range in.FooMap { - if v53First { - v53First = false + v47First := true + for v47Name, v47Value := range in.FooMap { + if v47First { + v47First = false } else { out.RawByte(',') } - out.String(string(v53Name)) + out.String(string(v47Name)) out.RawByte(':') - out.String(string(v53Value)) + out.String(string(v47Value)) } out.RawByte('}') } @@ -5686,9 +5322,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.DemoIds = (out.DemoIds)[:0] } for !in.IsDelim(']') { - var v54 string - v54 = string(in.String()) - out.DemoIds = append(out.DemoIds, v54) + var v48 string + v48 = string(in.String()) + out.DemoIds = append(out.DemoIds, v48) in.WantComma() } in.Delim(']') @@ -5735,11 +5371,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v55, v56 := range in.DemoIds { - if v55 > 0 { + for v49, v50 := range in.DemoIds { + if v49 > 0 { out.RawByte(',') } - out.String(string(v56)) + out.String(string(v50)) } out.RawByte(']') } @@ -6158,196 +5794,23 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if isTopLevel { in.Consumed() } - in.Skip() - return - } - var UserUUIDSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "userUUID": - out.UserUUID = string(in.String()) - UserUUIDSet = true - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } - if !UserUUIDSet { - in.AddError(fmt.Errorf("key 'userUUID' is required")) - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(out *jwriter.Writer, in Bar_DeleteFoo_Args) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"userUUID\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.UserUUID)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Bar_DeleteFoo_Args) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_DeleteFoo_Args) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_DeleteFoo_Args) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_DeleteFoo_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams(in *jlexer.Lexer, out *Bar_ArgWithUntaggedNestedQueryParams_Result) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "success": - if in.IsNull() { - in.Skip() - out.Success = nil - } else { - if out.Success == nil { - out.Success = new(BarResponse) - } - (*out.Success).UnmarshalEasyJSON(in) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams(out *jwriter.Writer, in Bar_ArgWithUntaggedNestedQueryParams_Result) { - out.RawByte('{') - first := true - _ = first - if in.Success != nil { - const prefix string = ",\"success\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - (*in.Success).MarshalEasyJSON(out) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams1(in *jlexer.Lexer, out *Bar_ArgWithUntaggedNestedQueryParams_Args) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - var RequestSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "request": - if in.IsNull() { - in.Skip() - out.Request = nil - } else { - if out.Request == nil { - out.Request = new(QueryParamsUntaggedStruct) - } - (*out.Request).UnmarshalEasyJSON(in) - } - RequestSet = true - case "opt": - if in.IsNull() { - in.Skip() - out.Opt = nil - } else { - if out.Opt == nil { - out.Opt = new(QueryParamsUntaggedOptStruct) - } - (*out.Opt).UnmarshalEasyJSON(in) - } + in.Skip() + return + } + var UserUUIDSet bool + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "userUUID": + out.UserUUID = string(in.String()) + UserUUIDSet = true default: in.SkipRecursive() } @@ -6357,63 +5820,49 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if isTopLevel { in.Consumed() } - if !RequestSet { - in.AddError(fmt.Errorf("key 'request' is required")) + if !UserUUIDSet { + in.AddError(fmt.Errorf("key 'userUUID' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams1(out *jwriter.Writer, in Bar_ArgWithUntaggedNestedQueryParams_Args) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(out *jwriter.Writer, in Bar_DeleteFoo_Args) { out.RawByte('{') first := true _ = first { - const prefix string = ",\"request\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - if in.Request == nil { - out.RawString("null") - } else { - (*in.Request).MarshalEasyJSON(out) - } - } - if in.Opt != nil { - const prefix string = ",\"opt\":" + const prefix string = ",\"userUUID\":" if first { first = false out.RawString(prefix[1:]) } else { out.RawString(prefix) } - (*in.Opt).MarshalEasyJSON(out) + out.String(string(in.UserUUID)) } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Args) MarshalJSON() ([]byte, error) { +func (v Bar_DeleteFoo_Args) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams1(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Args) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams1(w, v) +func (v Bar_DeleteFoo_Args) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(w, v) } // UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) UnmarshalJSON(data []byte) error { +func (v *Bar_DeleteFoo_Args) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams1(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithUntaggedNestedQueryParams1(l, v) +func (v *Bar_DeleteFoo_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarDeleteFoo1(l, v) } func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithQueryParams(in *jlexer.Lexer, out *Bar_ArgWithQueryParams_Result) { isTopLevel := in.IsStart() @@ -6544,9 +5993,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Foo = (out.Foo)[:0] } for !in.IsDelim(']') { - var v57 string - v57 = string(in.String()) - out.Foo = append(out.Foo, v57) + var v51 string + v51 = string(in.String()) + out.Foo = append(out.Foo, v51) in.WantComma() } in.Delim(']') @@ -6567,9 +6016,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Bar = (out.Bar)[:0] } for !in.IsDelim(']') { - var v58 int8 - v58 = int8(in.Int8()) - out.Bar = append(out.Bar, v58) + var v52 int8 + v52 = int8(in.Int8()) + out.Bar = append(out.Bar, v52) in.WantComma() } in.Delim(']') @@ -6625,11 +6074,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v59, v60 := range in.Foo { - if v59 > 0 { + for v53, v54 := range in.Foo { + if v53 > 0 { out.RawByte(',') } - out.String(string(v60)) + out.String(string(v54)) } out.RawByte(']') } @@ -6646,11 +6095,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v61, v62 := range in.Bar { - if v61 > 0 { + for v55, v56 := range in.Bar { + if v55 > 0 { out.RawByte(',') } - out.Int8(int8(v62)) + out.Int8(int8(v56)) } out.RawByte(']') } @@ -7385,6 +6834,221 @@ func (v *Bar_ArgWithNestedQueryParams_Args) UnmarshalJSON(data []byte) error { func (v *Bar_ArgWithNestedQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNestedQueryParams1(l, v) } +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams(in *jlexer.Lexer, out *Bar_ArgWithNearDupQueryParams_Result) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "success": + if in.IsNull() { + in.Skip() + out.Success = nil + } else { + if out.Success == nil { + out.Success = new(BarResponse) + } + (*out.Success).UnmarshalEasyJSON(in) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams(out *jwriter.Writer, in Bar_ArgWithNearDupQueryParams_Result) { + out.RawByte('{') + first := true + _ = first + if in.Success != nil { + const prefix string = ",\"success\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Success).MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Result) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Result) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Result) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams(l, v) +} +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams1(in *jlexer.Lexer, out *Bar_ArgWithNearDupQueryParams_Args) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + var OneSet bool + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "one": + out.One = string(in.String()) + OneSet = true + case "two": + if in.IsNull() { + in.Skip() + out.Two = nil + } else { + if out.Two == nil { + out.Two = new(int32) + } + *out.Two = int32(in.Int32()) + } + case "three": + if in.IsNull() { + in.Skip() + out.Three = nil + } else { + if out.Three == nil { + out.Three = new(string) + } + *out.Three = string(in.String()) + } + case "four": + if in.IsNull() { + in.Skip() + out.Four = nil + } else { + if out.Four == nil { + out.Four = new(string) + } + *out.Four = string(in.String()) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } + if !OneSet { + in.AddError(fmt.Errorf("key 'one' is required")) + } +} +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams1(out *jwriter.Writer, in Bar_ArgWithNearDupQueryParams_Args) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"one\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.One)) + } + if in.Two != nil { + const prefix string = ",\"two\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int32(int32(*in.Two)) + } + if in.Three != nil { + const prefix string = ",\"three\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(*in.Three)) + } + if in.Four != nil { + const prefix string = ",\"four\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(*in.Four)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Args) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams1(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Args) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams1(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Args) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams1(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithNearDupQueryParams1(l, v) +} func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgWithManyQueryParams(in *jlexer.Lexer, out *Bar_ArgWithManyQueryParams_Result) { isTopLevel := in.IsStart() if in.IsNull() { @@ -7615,9 +7279,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AListUUID = (out.AListUUID)[:0] } for !in.IsDelim(']') { - var v63 UUID - v63 = UUID(in.String()) - out.AListUUID = append(out.AListUUID, v63) + var v57 UUID + v57 = UUID(in.String()) + out.AListUUID = append(out.AListUUID, v57) in.WantComma() } in.Delim(']') @@ -7639,9 +7303,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptListUUID = (out.AnOptListUUID)[:0] } for !in.IsDelim(']') { - var v64 UUID - v64 = UUID(in.String()) - out.AnOptListUUID = append(out.AnOptListUUID, v64) + var v58 UUID + v58 = UUID(in.String()) + out.AnOptListUUID = append(out.AnOptListUUID, v58) in.WantComma() } in.Delim(']') @@ -7662,9 +7326,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AStringList = (out.AStringList)[:0] } for !in.IsDelim(']') { - var v65 string - v65 = string(in.String()) - out.AStringList = append(out.AStringList, v65) + var v59 string + v59 = string(in.String()) + out.AStringList = append(out.AStringList, v59) in.WantComma() } in.Delim(']') @@ -7686,9 +7350,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptStringList = (out.AnOptStringList)[:0] } for !in.IsDelim(']') { - var v66 string - v66 = string(in.String()) - out.AnOptStringList = append(out.AnOptStringList, v66) + var v60 string + v60 = string(in.String()) + out.AnOptStringList = append(out.AnOptStringList, v60) in.WantComma() } in.Delim(']') @@ -7709,9 +7373,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AUUIDList = (out.AUUIDList)[:0] } for !in.IsDelim(']') { - var v67 UUID - v67 = UUID(in.String()) - out.AUUIDList = append(out.AUUIDList, v67) + var v61 UUID + v61 = UUID(in.String()) + out.AUUIDList = append(out.AUUIDList, v61) in.WantComma() } in.Delim(']') @@ -7733,9 +7397,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptUUIDList = (out.AnOptUUIDList)[:0] } for !in.IsDelim(']') { - var v68 UUID - v68 = UUID(in.String()) - out.AnOptUUIDList = append(out.AnOptUUIDList, v68) + var v62 UUID + v62 = UUID(in.String()) + out.AnOptUUIDList = append(out.AnOptUUIDList, v62) in.WantComma() } in.Delim(']') @@ -7979,11 +7643,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v69, v70 := range in.AListUUID { - if v69 > 0 { + for v63, v64 := range in.AListUUID { + if v63 > 0 { out.RawByte(',') } - out.String(string(v70)) + out.String(string(v64)) } out.RawByte(']') } @@ -7998,11 +7662,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v71, v72 := range in.AnOptListUUID { - if v71 > 0 { + for v65, v66 := range in.AnOptListUUID { + if v65 > 0 { out.RawByte(',') } - out.String(string(v72)) + out.String(string(v66)) } out.RawByte(']') } @@ -8019,11 +7683,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v73, v74 := range in.AStringList { - if v73 > 0 { + for v67, v68 := range in.AStringList { + if v67 > 0 { out.RawByte(',') } - out.String(string(v74)) + out.String(string(v68)) } out.RawByte(']') } @@ -8038,11 +7702,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v75, v76 := range in.AnOptStringList { - if v75 > 0 { + for v69, v70 := range in.AnOptStringList { + if v69 > 0 { out.RawByte(',') } - out.String(string(v76)) + out.String(string(v70)) } out.RawByte(']') } @@ -8059,11 +7723,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v77, v78 := range in.AUUIDList { - if v77 > 0 { + for v71, v72 := range in.AUUIDList { + if v71 > 0 { out.RawByte(',') } - out.String(string(v78)) + out.String(string(v72)) } out.RawByte(']') } @@ -8078,11 +7742,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v79, v80 := range in.AnOptUUIDList { - if v79 > 0 { + for v73, v74 := range in.AnOptUUIDList { + if v73 > 0 { out.RawByte(',') } - out.String(string(v80)) + out.String(string(v74)) } out.RawByte(']') } @@ -8426,7 +8090,7 @@ func (v *Bar_ArgNotStruct_Args) UnmarshalJSON(data []byte) error { func (v *Bar_ArgNotStruct_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBarBarArgNotStruct1(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(in *jlexer.Lexer, out *BarResponseRecur) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(in *jlexer.Lexer, out *BarResponseRecur) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -8463,9 +8127,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Nodes = (out.Nodes)[:0] } for !in.IsDelim(']') { - var v81 string - v81 = string(in.String()) - out.Nodes = append(out.Nodes, v81) + var v75 string + v75 = string(in.String()) + out.Nodes = append(out.Nodes, v75) in.WantComma() } in.Delim(']') @@ -8490,7 +8154,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'height' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(out *jwriter.Writer, in BarResponseRecur) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(out *jwriter.Writer, in BarResponseRecur) { out.RawByte('{') first := true _ = first @@ -8506,11 +8170,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v82, v83 := range in.Nodes { - if v82 > 0 { + for v76, v77 := range in.Nodes { + if v76 > 0 { out.RawByte(',') } - out.String(string(v83)) + out.String(string(v77)) } out.RawByte(']') } @@ -8531,27 +8195,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarResponseRecur) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarResponseRecur) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarResponseRecur) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarResponseRecur) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar4(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(in *jlexer.Lexer, out *BarResponse) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(in *jlexer.Lexer, out *BarResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -8598,9 +8262,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := UUID(in.String()) in.WantColon() - var v84 int32 - v84 = int32(in.Int32()) - (out.MapIntWithRange)[key] = v84 + var v78 int32 + v78 = int32(in.Int32()) + (out.MapIntWithRange)[key] = v78 in.WantComma() } in.Delim('}') @@ -8619,9 +8283,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v85 int32 - v85 = int32(in.Int32()) - (out.MapIntWithoutRange)[key] = v85 + var v79 int32 + v79 = int32(in.Int32()) + (out.MapIntWithoutRange)[key] = v79 in.WantComma() } in.Delim('}') @@ -8673,7 +8337,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'binaryField' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(out *jwriter.Writer, in BarResponse) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(out *jwriter.Writer, in BarResponse) { out.RawByte('{') first := true _ = first @@ -8719,16 +8383,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v87First := true - for v87Name, v87Value := range in.MapIntWithRange { - if v87First { - v87First = false + v81First := true + for v81Name, v81Value := range in.MapIntWithRange { + if v81First { + v81First = false } else { out.RawByte(',') } - out.String(string(v87Name)) + out.String(string(v81Name)) out.RawByte(':') - out.Int32(int32(v87Value)) + out.Int32(int32(v81Value)) } out.RawByte('}') } @@ -8745,16 +8409,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v88First := true - for v88Name, v88Value := range in.MapIntWithoutRange { - if v88First { - v88First = false + v82First := true + for v82Name, v82Value := range in.MapIntWithoutRange { + if v82First { + v82First = false } else { out.RawByte(',') } - out.String(string(v88Name)) + out.String(string(v82Name)) out.RawByte(':') - out.Int32(int32(v88Value)) + out.Int32(int32(v82Value)) } out.RawByte('}') } @@ -8785,27 +8449,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar5(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(in *jlexer.Lexer, out *BarRequestRecur) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(in *jlexer.Lexer, out *BarRequestRecur) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -8851,7 +8515,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'name' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(out *jwriter.Writer, in BarRequestRecur) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(out *jwriter.Writer, in BarRequestRecur) { out.RawByte('{') first := true _ = first @@ -8881,27 +8545,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarRequestRecur) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarRequestRecur) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarRequestRecur) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarRequestRecur) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar6(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar9(in *jlexer.Lexer, out *BarRequest) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(in *jlexer.Lexer, out *BarRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -8983,7 +8647,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'longField' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar9(out *jwriter.Writer, in BarRequest) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(out *jwriter.Writer, in BarRequest) { out.RawByte('{') first := true _ = first @@ -9053,27 +8717,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar9(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar9(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar9(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar9(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar7(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar10(in *jlexer.Lexer, out *BarException) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(in *jlexer.Lexer, out *BarException) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -9109,7 +8773,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'stringField' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar10(out *jwriter.Writer, in BarException) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(out *jwriter.Writer, in BarException) { out.RawByte('{') first := true _ = first @@ -9129,23 +8793,23 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarException) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar10(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarException) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar10(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarException) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar10(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarException) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar10(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeClientsBarBar8(l, v) } diff --git a/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar.go b/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar.go index 21533f9d2..705b1ed0b 100644 --- a/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar.go +++ b/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar.go @@ -2211,614 +2211,6 @@ func (v *QueryParamsStruct) IsSetFoo() bool { return v != nil && v.Foo != nil } -type QueryParamsUntaggedOptStruct struct { - Name string `json:"name,required"` - UserUUID *string `json:"userUUID,omitempty"` - Count int32 `json:"count,required"` - OptCount *int32 `json:"optCount,omitempty"` - Foos []string `json:"foos,required"` -} - -// ToWire translates a QueryParamsUntaggedOptStruct struct into a Thrift-level intermediate -// representation. This intermediate representation may be serialized -// into bytes using a ThriftRW protocol implementation. -// -// An error is returned if the struct or any of its fields failed to -// validate. -// -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } -func (v *QueryParamsUntaggedOptStruct) ToWire() (wire.Value, error) { - var ( - fields [5]wire.Field - i int = 0 - w wire.Value - err error - ) - - w, err = wire.NewValueString(v.Name), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ - if v.UserUUID != nil { - w, err = wire.NewValueString(*(v.UserUUID)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 2, Value: w} - i++ - } - - w, err = wire.NewValueI32(v.Count), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 3, Value: w} - i++ - if v.OptCount != nil { - w, err = wire.NewValueI32(*(v.OptCount)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 4, Value: w} - i++ - } - if v.Foos == nil { - return w, errors.New("field Foos of QueryParamsUntaggedOptStruct is required") - } - w, err = wire.NewValueList(_List_String_ValueList(v.Foos)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 5, Value: w} - i++ - - return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil -} - -// FromWire deserializes a QueryParamsUntaggedOptStruct struct from its Thrift-level -// representation. The Thrift-level representation may be obtained -// from a ThriftRW protocol implementation. -// -// An error is returned if we were unable to build a QueryParamsUntaggedOptStruct struct -// from the provided intermediate representation. -// -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } -// -// var v QueryParamsUntaggedOptStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil -func (v *QueryParamsUntaggedOptStruct) FromWire(w wire.Value) error { - var err error - - nameIsSet := false - - countIsSet := false - - foosIsSet := false - - for _, field := range w.GetStruct().Fields { - switch field.ID { - case 1: - if field.Value.Type() == wire.TBinary { - v.Name, err = field.Value.GetString(), error(nil) - if err != nil { - return err - } - nameIsSet = true - } - case 2: - if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.UserUUID = &x - if err != nil { - return err - } - - } - case 3: - if field.Value.Type() == wire.TI32 { - v.Count, err = field.Value.GetI32(), error(nil) - if err != nil { - return err - } - countIsSet = true - } - case 4: - if field.Value.Type() == wire.TI32 { - var x int32 - x, err = field.Value.GetI32(), error(nil) - v.OptCount = &x - if err != nil { - return err - } - - } - case 5: - if field.Value.Type() == wire.TList { - v.Foos, err = _List_String_Read(field.Value.GetList()) - if err != nil { - return err - } - foosIsSet = true - } - } - } - - if !nameIsSet { - return errors.New("field Name of QueryParamsUntaggedOptStruct is required") - } - - if !countIsSet { - return errors.New("field Count of QueryParamsUntaggedOptStruct is required") - } - - if !foosIsSet { - return errors.New("field Foos of QueryParamsUntaggedOptStruct is required") - } - - return nil -} - -// String returns a readable string representation of a QueryParamsUntaggedOptStruct -// struct. -func (v *QueryParamsUntaggedOptStruct) String() string { - if v == nil { - return "" - } - - var fields [5]string - i := 0 - fields[i] = fmt.Sprintf("Name: %v", v.Name) - i++ - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } - fields[i] = fmt.Sprintf("Count: %v", v.Count) - i++ - if v.OptCount != nil { - fields[i] = fmt.Sprintf("OptCount: %v", *(v.OptCount)) - i++ - } - fields[i] = fmt.Sprintf("Foos: %v", v.Foos) - i++ - - return fmt.Sprintf("QueryParamsUntaggedOptStruct{%v}", strings.Join(fields[:i], ", ")) -} - -func _I32_EqualsPtr(lhs, rhs *int32) bool { - if lhs != nil && rhs != nil { - - x := *lhs - y := *rhs - return (x == y) - } - return lhs == nil && rhs == nil -} - -// Equals returns true if all the fields of this QueryParamsUntaggedOptStruct match the -// provided QueryParamsUntaggedOptStruct. -// -// This function performs a deep comparison. -func (v *QueryParamsUntaggedOptStruct) Equals(rhs *QueryParamsUntaggedOptStruct) bool { - if v == nil { - return rhs == nil - } else if rhs == nil { - return false - } - if !(v.Name == rhs.Name) { - return false - } - if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { - return false - } - if !(v.Count == rhs.Count) { - return false - } - if !_I32_EqualsPtr(v.OptCount, rhs.OptCount) { - return false - } - if !_List_String_Equals(v.Foos, rhs.Foos) { - return false - } - - return true -} - -// MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of QueryParamsUntaggedOptStruct. -func (v *QueryParamsUntaggedOptStruct) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { - if v == nil { - return nil - } - enc.AddString("name", v.Name) - if v.UserUUID != nil { - enc.AddString("userUUID", *v.UserUUID) - } - enc.AddInt32("count", v.Count) - if v.OptCount != nil { - enc.AddInt32("optCount", *v.OptCount) - } - err = multierr.Append(err, enc.AddArray("foos", (_List_String_Zapper)(v.Foos))) - return err -} - -// GetName returns the value of Name if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetName() (o string) { - if v != nil { - o = v.Name - } - return -} - -// GetUserUUID returns the value of UserUUID if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetUserUUID() (o string) { - if v != nil && v.UserUUID != nil { - return *v.UserUUID - } - - return -} - -// IsSetUserUUID returns true if UserUUID is not nil. -func (v *QueryParamsUntaggedOptStruct) IsSetUserUUID() bool { - return v != nil && v.UserUUID != nil -} - -// GetCount returns the value of Count if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetCount() (o int32) { - if v != nil { - o = v.Count - } - return -} - -// GetOptCount returns the value of OptCount if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetOptCount() (o int32) { - if v != nil && v.OptCount != nil { - return *v.OptCount - } - - return -} - -// IsSetOptCount returns true if OptCount is not nil. -func (v *QueryParamsUntaggedOptStruct) IsSetOptCount() bool { - return v != nil && v.OptCount != nil -} - -// GetFoos returns the value of Foos if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedOptStruct) GetFoos() (o []string) { - if v != nil { - o = v.Foos - } - return -} - -// IsSetFoos returns true if Foos is not nil. -func (v *QueryParamsUntaggedOptStruct) IsSetFoos() bool { - return v != nil && v.Foos != nil -} - -type QueryParamsUntaggedStruct struct { - Name string `json:"name,required"` - UserUUID *string `json:"userUUID,omitempty"` - Count int32 `json:"count,required"` - OptCount *int32 `json:"optCount,omitempty"` - Foos []string `json:"foos,required"` -} - -// ToWire translates a QueryParamsUntaggedStruct struct into a Thrift-level intermediate -// representation. This intermediate representation may be serialized -// into bytes using a ThriftRW protocol implementation. -// -// An error is returned if the struct or any of its fields failed to -// validate. -// -// x, err := v.ToWire() -// if err != nil { -// return err -// } -// -// if err := binaryProtocol.Encode(x, writer); err != nil { -// return err -// } -func (v *QueryParamsUntaggedStruct) ToWire() (wire.Value, error) { - var ( - fields [5]wire.Field - i int = 0 - w wire.Value - err error - ) - - w, err = wire.NewValueString(v.Name), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ - if v.UserUUID != nil { - w, err = wire.NewValueString(*(v.UserUUID)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 2, Value: w} - i++ - } - - w, err = wire.NewValueI32(v.Count), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 3, Value: w} - i++ - if v.OptCount != nil { - w, err = wire.NewValueI32(*(v.OptCount)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 4, Value: w} - i++ - } - if v.Foos == nil { - return w, errors.New("field Foos of QueryParamsUntaggedStruct is required") - } - w, err = wire.NewValueList(_List_String_ValueList(v.Foos)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 5, Value: w} - i++ - - return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil -} - -// FromWire deserializes a QueryParamsUntaggedStruct struct from its Thrift-level -// representation. The Thrift-level representation may be obtained -// from a ThriftRW protocol implementation. -// -// An error is returned if we were unable to build a QueryParamsUntaggedStruct struct -// from the provided intermediate representation. -// -// x, err := binaryProtocol.Decode(reader, wire.TStruct) -// if err != nil { -// return nil, err -// } -// -// var v QueryParamsUntaggedStruct -// if err := v.FromWire(x); err != nil { -// return nil, err -// } -// return &v, nil -func (v *QueryParamsUntaggedStruct) FromWire(w wire.Value) error { - var err error - - nameIsSet := false - - countIsSet := false - - foosIsSet := false - - for _, field := range w.GetStruct().Fields { - switch field.ID { - case 1: - if field.Value.Type() == wire.TBinary { - v.Name, err = field.Value.GetString(), error(nil) - if err != nil { - return err - } - nameIsSet = true - } - case 2: - if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.UserUUID = &x - if err != nil { - return err - } - - } - case 3: - if field.Value.Type() == wire.TI32 { - v.Count, err = field.Value.GetI32(), error(nil) - if err != nil { - return err - } - countIsSet = true - } - case 4: - if field.Value.Type() == wire.TI32 { - var x int32 - x, err = field.Value.GetI32(), error(nil) - v.OptCount = &x - if err != nil { - return err - } - - } - case 5: - if field.Value.Type() == wire.TList { - v.Foos, err = _List_String_Read(field.Value.GetList()) - if err != nil { - return err - } - foosIsSet = true - } - } - } - - if !nameIsSet { - return errors.New("field Name of QueryParamsUntaggedStruct is required") - } - - if !countIsSet { - return errors.New("field Count of QueryParamsUntaggedStruct is required") - } - - if !foosIsSet { - return errors.New("field Foos of QueryParamsUntaggedStruct is required") - } - - return nil -} - -// String returns a readable string representation of a QueryParamsUntaggedStruct -// struct. -func (v *QueryParamsUntaggedStruct) String() string { - if v == nil { - return "" - } - - var fields [5]string - i := 0 - fields[i] = fmt.Sprintf("Name: %v", v.Name) - i++ - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } - fields[i] = fmt.Sprintf("Count: %v", v.Count) - i++ - if v.OptCount != nil { - fields[i] = fmt.Sprintf("OptCount: %v", *(v.OptCount)) - i++ - } - fields[i] = fmt.Sprintf("Foos: %v", v.Foos) - i++ - - return fmt.Sprintf("QueryParamsUntaggedStruct{%v}", strings.Join(fields[:i], ", ")) -} - -// Equals returns true if all the fields of this QueryParamsUntaggedStruct match the -// provided QueryParamsUntaggedStruct. -// -// This function performs a deep comparison. -func (v *QueryParamsUntaggedStruct) Equals(rhs *QueryParamsUntaggedStruct) bool { - if v == nil { - return rhs == nil - } else if rhs == nil { - return false - } - if !(v.Name == rhs.Name) { - return false - } - if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { - return false - } - if !(v.Count == rhs.Count) { - return false - } - if !_I32_EqualsPtr(v.OptCount, rhs.OptCount) { - return false - } - if !_List_String_Equals(v.Foos, rhs.Foos) { - return false - } - - return true -} - -// MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of QueryParamsUntaggedStruct. -func (v *QueryParamsUntaggedStruct) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { - if v == nil { - return nil - } - enc.AddString("name", v.Name) - if v.UserUUID != nil { - enc.AddString("userUUID", *v.UserUUID) - } - enc.AddInt32("count", v.Count) - if v.OptCount != nil { - enc.AddInt32("optCount", *v.OptCount) - } - err = multierr.Append(err, enc.AddArray("foos", (_List_String_Zapper)(v.Foos))) - return err -} - -// GetName returns the value of Name if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetName() (o string) { - if v != nil { - o = v.Name - } - return -} - -// GetUserUUID returns the value of UserUUID if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetUserUUID() (o string) { - if v != nil && v.UserUUID != nil { - return *v.UserUUID - } - - return -} - -// IsSetUserUUID returns true if UserUUID is not nil. -func (v *QueryParamsUntaggedStruct) IsSetUserUUID() bool { - return v != nil && v.UserUUID != nil -} - -// GetCount returns the value of Count if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetCount() (o int32) { - if v != nil { - o = v.Count - } - return -} - -// GetOptCount returns the value of OptCount if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetOptCount() (o int32) { - if v != nil && v.OptCount != nil { - return *v.OptCount - } - - return -} - -// IsSetOptCount returns true if OptCount is not nil. -func (v *QueryParamsUntaggedStruct) IsSetOptCount() bool { - return v != nil && v.OptCount != nil -} - -// GetFoos returns the value of Foos if it is set or its -// zero value if it is unset. -func (v *QueryParamsUntaggedStruct) GetFoos() (o []string) { - if v != nil { - o = v.Foos - } - return -} - -// IsSetFoos returns true if Foos is not nil. -func (v *QueryParamsUntaggedStruct) IsSetFoos() bool { - return v != nil && v.Foos != nil -} - type RequestWithDuplicateType struct { Request1 *BarRequest `json:"request1,omitempty"` Request2 *BarRequest `json:"request2,omitempty"` @@ -4748,6 +4140,16 @@ func _I16_EqualsPtr(lhs, rhs *int16) bool { return lhs == nil && rhs == nil } +func _I32_EqualsPtr(lhs, rhs *int32) bool { + if lhs != nil && rhs != nil { + + x := *lhs + y := *rhs + return (x == y) + } + return lhs == nil && rhs == nil +} + func _I64_EqualsPtr(lhs, rhs *int64) bool { if lhs != nil && rhs != nil { @@ -5568,15 +4970,17 @@ func (v *Bar_ArgWithManyQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithNestedQueryParams_Args represents the arguments for the Bar.argWithNestedQueryParams function. +// Bar_ArgWithNearDupQueryParams_Args represents the arguments for the Bar.argWithNearDupQueryParams function. // -// The arguments for argWithNestedQueryParams are sent and received over the wire as this struct. -type Bar_ArgWithNestedQueryParams_Args struct { - Request *QueryParamsStruct `json:"request,required"` - Opt *QueryParamsOptsStruct `json:"opt,omitempty"` +// The arguments for argWithNearDupQueryParams are sent and received over the wire as this struct. +type Bar_ArgWithNearDupQueryParams_Args struct { + One string `json:"one,required"` + Two *int32 `json:"two,omitempty"` + Three *string `json:"three,omitempty"` + Four *string `json:"four,omitempty"` } -// ToWire translates a Bar_ArgWithNestedQueryParams_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNearDupQueryParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -5591,52 +4995,53 @@ type Bar_ArgWithNestedQueryParams_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNearDupQueryParams_Args) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error ) - if v.Request == nil { - return w, errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") - } - w, err = v.Request.ToWire() + w, err = wire.NewValueString(v.One), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - if v.Opt != nil { - w, err = v.Opt.ToWire() + if v.Two != nil { + w, err = wire.NewValueI32(*(v.Two)), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 2, Value: w} i++ } + if v.Three != nil { + w, err = wire.NewValueString(*(v.Three)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 3, Value: w} + i++ + } + if v.Four != nil { + w, err = wire.NewValueString(*(v.Four)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ + } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _QueryParamsStruct_Read(w wire.Value) (*QueryParamsStruct, error) { - var v QueryParamsStruct - err := v.FromWire(w) - return &v, err -} - -func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { - var v QueryParamsOptsStruct - err := v.FromWire(w) - return &v, err -} - -// FromWire deserializes a Bar_ArgWithNestedQueryParams_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithNearDupQueryParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -5644,29 +5049,51 @@ func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { // return nil, err // } // -// var v Bar_ArgWithNestedQueryParams_Args +// var v Bar_ArgWithNearDupQueryParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNearDupQueryParams_Args) FromWire(w wire.Value) error { var err error - requestIsSet := false + oneIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TStruct { - v.Request, err = _QueryParamsStruct_Read(field.Value) + if field.Value.Type() == wire.TBinary { + v.One, err = field.Value.GetString(), error(nil) if err != nil { return err } - requestIsSet = true + oneIsSet = true } case 2: - if field.Value.Type() == wire.TStruct { - v.Opt, err = _QueryParamsOptsStruct_Read(field.Value) + if field.Value.Type() == wire.TI32 { + var x int32 + x, err = field.Value.GetI32(), error(nil) + v.Two = &x + if err != nil { + return err + } + + } + case 3: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Three = &x + if err != nil { + return err + } + + } + case 4: + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.Four = &x if err != nil { return err } @@ -5675,46 +5102,60 @@ func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { } } - if !requestIsSet { - return errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") + if !oneIsSet { + return errors.New("field One of Bar_ArgWithNearDupQueryParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Args +// String returns a readable string representation of a Bar_ArgWithNearDupQueryParams_Args // struct. -func (v *Bar_ArgWithNestedQueryParams_Args) String() string { +func (v *Bar_ArgWithNearDupQueryParams_Args) String() string { if v == nil { return "" } - var fields [2]string + var fields [4]string i := 0 - fields[i] = fmt.Sprintf("Request: %v", v.Request) + fields[i] = fmt.Sprintf("One: %v", v.One) i++ - if v.Opt != nil { - fields[i] = fmt.Sprintf("Opt: %v", v.Opt) + if v.Two != nil { + fields[i] = fmt.Sprintf("Two: %v", *(v.Two)) + i++ + } + if v.Three != nil { + fields[i] = fmt.Sprintf("Three: %v", *(v.Three)) + i++ + } + if v.Four != nil { + fields[i] = fmt.Sprintf("Four: %v", *(v.Four)) i++ } - return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNearDupQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Args match the -// provided Bar_ArgWithNestedQueryParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithNearDupQueryParams_Args match the +// provided Bar_ArgWithNearDupQueryParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithNestedQueryParams_Args) Equals(rhs *Bar_ArgWithNestedQueryParams_Args) bool { +func (v *Bar_ArgWithNearDupQueryParams_Args) Equals(rhs *Bar_ArgWithNearDupQueryParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !v.Request.Equals(rhs.Request) { + if !(v.One == rhs.One) { return false } - if !((v.Opt == nil && rhs.Opt == nil) || (v.Opt != nil && rhs.Opt != nil && v.Opt.Equals(rhs.Opt))) { + if !_I32_EqualsPtr(v.Two, rhs.Two) { + return false + } + if !_String_EqualsPtr(v.Three, rhs.Three) { + return false + } + if !_String_EqualsPtr(v.Four, rhs.Four) { return false } @@ -5722,134 +5163,171 @@ func (v *Bar_ArgWithNestedQueryParams_Args) Equals(rhs *Bar_ArgWithNestedQueryPa } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithNestedQueryParams_Args. -func (v *Bar_ArgWithNestedQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNearDupQueryParams_Args. +func (v *Bar_ArgWithNearDupQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - err = multierr.Append(err, enc.AddObject("request", v.Request)) - if v.Opt != nil { - err = multierr.Append(err, enc.AddObject("opt", v.Opt)) + enc.AddString("one", v.One) + if v.Two != nil { + enc.AddInt32("two", *v.Two) + } + if v.Three != nil { + enc.AddString("three", *v.Three) + } + if v.Four != nil { + enc.AddString("four", *v.Four) } return err } -// GetRequest returns the value of Request if it is set or its +// GetOne returns the value of One if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithNestedQueryParams_Args) GetRequest() (o *QueryParamsStruct) { +func (v *Bar_ArgWithNearDupQueryParams_Args) GetOne() (o string) { if v != nil { - o = v.Request + o = v.One } return } -// IsSetRequest returns true if Request is not nil. -func (v *Bar_ArgWithNestedQueryParams_Args) IsSetRequest() bool { - return v != nil && v.Request != nil +// GetTwo returns the value of Two if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithNearDupQueryParams_Args) GetTwo() (o int32) { + if v != nil && v.Two != nil { + return *v.Two + } + + return } -// GetOpt returns the value of Opt if it is set or its +// IsSetTwo returns true if Two is not nil. +func (v *Bar_ArgWithNearDupQueryParams_Args) IsSetTwo() bool { + return v != nil && v.Two != nil +} + +// GetThree returns the value of Three if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithNestedQueryParams_Args) GetOpt() (o *QueryParamsOptsStruct) { - if v != nil && v.Opt != nil { - return v.Opt +func (v *Bar_ArgWithNearDupQueryParams_Args) GetThree() (o string) { + if v != nil && v.Three != nil { + return *v.Three } return } -// IsSetOpt returns true if Opt is not nil. -func (v *Bar_ArgWithNestedQueryParams_Args) IsSetOpt() bool { - return v != nil && v.Opt != nil +// IsSetThree returns true if Three is not nil. +func (v *Bar_ArgWithNearDupQueryParams_Args) IsSetThree() bool { + return v != nil && v.Three != nil +} + +// GetFour returns the value of Four if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithNearDupQueryParams_Args) GetFour() (o string) { + if v != nil && v.Four != nil { + return *v.Four + } + + return +} + +// IsSetFour returns true if Four is not nil. +func (v *Bar_ArgWithNearDupQueryParams_Args) IsSetFour() bool { + return v != nil && v.Four != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithNestedQueryParams" for this struct. -func (v *Bar_ArgWithNestedQueryParams_Args) MethodName() string { - return "argWithNestedQueryParams" +// This will always be "argWithNearDupQueryParams" for this struct. +func (v *Bar_ArgWithNearDupQueryParams_Args) MethodName() string { + return "argWithNearDupQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithNestedQueryParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNearDupQueryParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithNestedQueryParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithNestedQueryParams +// Bar_ArgWithNearDupQueryParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithNearDupQueryParams // function. -var Bar_ArgWithNestedQueryParams_Helper = struct { - // Args accepts the parameters of argWithNestedQueryParams in-order and returns +var Bar_ArgWithNearDupQueryParams_Helper = struct { + // Args accepts the parameters of argWithNearDupQueryParams in-order and returns // the arguments struct for the function. Args func( - request *QueryParamsStruct, - opt *QueryParamsOptsStruct, - ) *Bar_ArgWithNestedQueryParams_Args + one string, + two *int32, + three *string, + four *string, + ) *Bar_ArgWithNearDupQueryParams_Args // IsException returns true if the given error can be thrown - // by argWithNestedQueryParams. + // by argWithNearDupQueryParams. // - // An error can be thrown by argWithNestedQueryParams only if the + // An error can be thrown by argWithNearDupQueryParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithNestedQueryParams + // WrapResponse returns the result struct for argWithNearDupQueryParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithNestedQueryParams into a serializable result struct. + // argWithNearDupQueryParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithNestedQueryParams + // error cannot be thrown by argWithNearDupQueryParams // - // value, err := argWithNestedQueryParams(args) - // result, err := Bar_ArgWithNestedQueryParams_Helper.WrapResponse(value, err) + // value, err := argWithNearDupQueryParams(args) + // result, err := Bar_ArgWithNearDupQueryParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithNestedQueryParams: %v", err) + // return fmt.Errorf("unexpected error from argWithNearDupQueryParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithNestedQueryParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithNearDupQueryParams_Result, error) - // UnwrapResponse takes the result struct for argWithNestedQueryParams + // UnwrapResponse takes the result struct for argWithNearDupQueryParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithNestedQueryParams threw an + // The error is non-nil only if argWithNearDupQueryParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithNestedQueryParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithNearDupQueryParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithNearDupQueryParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithNestedQueryParams_Helper.Args = func( - request *QueryParamsStruct, - opt *QueryParamsOptsStruct, - ) *Bar_ArgWithNestedQueryParams_Args { - return &Bar_ArgWithNestedQueryParams_Args{ - Request: request, - Opt: opt, + Bar_ArgWithNearDupQueryParams_Helper.Args = func( + one string, + two *int32, + three *string, + four *string, + ) *Bar_ArgWithNearDupQueryParams_Args { + return &Bar_ArgWithNearDupQueryParams_Args{ + One: one, + Two: two, + Three: three, + Four: four, } } - Bar_ArgWithNestedQueryParams_Helper.IsException = func(err error) bool { + Bar_ArgWithNearDupQueryParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithNestedQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithNestedQueryParams_Result, error) { + Bar_ArgWithNearDupQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithNearDupQueryParams_Result, error) { if err == nil { - return &Bar_ArgWithNestedQueryParams_Result{Success: success}, nil + return &Bar_ArgWithNearDupQueryParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithNestedQueryParams_Result) (success *BarResponse, err error) { + Bar_ArgWithNearDupQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithNearDupQueryParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -5862,17 +5340,17 @@ func init() { } -// Bar_ArgWithNestedQueryParams_Result represents the result of a Bar.argWithNestedQueryParams function call. +// Bar_ArgWithNearDupQueryParams_Result represents the result of a Bar.argWithNearDupQueryParams function call. // -// The result of a argWithNestedQueryParams execution is sent and received over the wire as this struct. +// The result of a argWithNearDupQueryParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithNestedQueryParams_Result struct { - // Value returned by argWithNestedQueryParams after a successful execution. +type Bar_ArgWithNearDupQueryParams_Result struct { + // Value returned by argWithNearDupQueryParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithNestedQueryParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNearDupQueryParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -5887,7 +5365,7 @@ type Bar_ArgWithNestedQueryParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNearDupQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -5905,17 +5383,17 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithNearDupQueryParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithNestedQueryParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithNearDupQueryParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithNearDupQueryParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -5923,12 +5401,12 @@ func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithNestedQueryParams_Result +// var v Bar_ArgWithNearDupQueryParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNearDupQueryParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -5949,15 +5427,15 @@ func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithNearDupQueryParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Result +// String returns a readable string representation of a Bar_ArgWithNearDupQueryParams_Result // struct. -func (v *Bar_ArgWithNestedQueryParams_Result) String() string { +func (v *Bar_ArgWithNearDupQueryParams_Result) String() string { if v == nil { return "" } @@ -5969,14 +5447,14 @@ func (v *Bar_ArgWithNestedQueryParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNearDupQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Result match the -// provided Bar_ArgWithNestedQueryParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithNearDupQueryParams_Result match the +// provided Bar_ArgWithNearDupQueryParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithNestedQueryParams_Result) Equals(rhs *Bar_ArgWithNestedQueryParams_Result) bool { +func (v *Bar_ArgWithNearDupQueryParams_Result) Equals(rhs *Bar_ArgWithNearDupQueryParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -5990,8 +5468,8 @@ func (v *Bar_ArgWithNestedQueryParams_Result) Equals(rhs *Bar_ArgWithNestedQuery } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithNestedQueryParams_Result. -func (v *Bar_ArgWithNestedQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNearDupQueryParams_Result. +func (v *Bar_ArgWithNearDupQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -6003,7 +5481,7 @@ func (v *Bar_ArgWithNestedQueryParams_Result) MarshalLogObject(enc zapcore.Objec // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithNestedQueryParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithNearDupQueryParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -6012,34 +5490,34 @@ func (v *Bar_ArgWithNestedQueryParams_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithNestedQueryParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithNearDupQueryParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithNestedQueryParams" for this struct. -func (v *Bar_ArgWithNestedQueryParams_Result) MethodName() string { - return "argWithNestedQueryParams" +// This will always be "argWithNearDupQueryParams" for this struct. +func (v *Bar_ArgWithNearDupQueryParams_Result) MethodName() string { + return "argWithNearDupQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithNestedQueryParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNearDupQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithParams_Args represents the arguments for the Bar.argWithParams function. +// Bar_ArgWithNestedQueryParams_Args represents the arguments for the Bar.argWithNestedQueryParams function. // -// The arguments for argWithParams are sent and received over the wire as this struct. -type Bar_ArgWithParams_Args struct { - UUID string `json:"-"` - Params *ParamsStruct `json:"params,omitempty"` +// The arguments for argWithNestedQueryParams are sent and received over the wire as this struct. +type Bar_ArgWithNestedQueryParams_Args struct { + Request *QueryParamsStruct `json:"request,required"` + Opt *QueryParamsOptsStruct `json:"opt,omitempty"` } -// ToWire translates a Bar_ArgWithParams_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNestedQueryParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6054,7 +5532,7 @@ type Bar_ArgWithParams_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNestedQueryParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field i int = 0 @@ -6062,14 +5540,17 @@ func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { err error ) - w, err = wire.NewValueString(v.UUID), error(nil) + if v.Request == nil { + return w, errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") + } + w, err = v.Request.ToWire() if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - if v.Params != nil { - w, err = v.Params.ToWire() + if v.Opt != nil { + w, err = v.Opt.ToWire() if err != nil { return w, err } @@ -6080,17 +5561,23 @@ func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { - var v ParamsStruct +func _QueryParamsStruct_Read(w wire.Value) (*QueryParamsStruct, error) { + var v QueryParamsStruct err := v.FromWire(w) return &v, err } -// FromWire deserializes a Bar_ArgWithParams_Args struct from its Thrift-level +func _QueryParamsOptsStruct_Read(w wire.Value) (*QueryParamsOptsStruct, error) { + var v QueryParamsOptsStruct + err := v.FromWire(w) + return &v, err +} + +// FromWire deserializes a Bar_ArgWithNestedQueryParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6098,29 +5585,29 @@ func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { // return nil, err // } // -// var v Bar_ArgWithParams_Args +// var v Bar_ArgWithNestedQueryParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNestedQueryParams_Args) FromWire(w wire.Value) error { var err error - uuidIsSet := false + requestIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TBinary { - v.UUID, err = field.Value.GetString(), error(nil) + if field.Value.Type() == wire.TStruct { + v.Request, err = _QueryParamsStruct_Read(field.Value) if err != nil { return err } - uuidIsSet = true + requestIsSet = true } case 2: if field.Value.Type() == wire.TStruct { - v.Params, err = _ParamsStruct_Read(field.Value) + v.Opt, err = _QueryParamsOptsStruct_Read(field.Value) if err != nil { return err } @@ -6129,46 +5616,46 @@ func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { } } - if !uuidIsSet { - return errors.New("field UUID of Bar_ArgWithParams_Args is required") + if !requestIsSet { + return errors.New("field Request of Bar_ArgWithNestedQueryParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithParams_Args +// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Args // struct. -func (v *Bar_ArgWithParams_Args) String() string { +func (v *Bar_ArgWithNestedQueryParams_Args) String() string { if v == nil { return "" } var fields [2]string i := 0 - fields[i] = fmt.Sprintf("UUID: %v", v.UUID) + fields[i] = fmt.Sprintf("Request: %v", v.Request) i++ - if v.Params != nil { - fields[i] = fmt.Sprintf("Params: %v", v.Params) + if v.Opt != nil { + fields[i] = fmt.Sprintf("Opt: %v", v.Opt) i++ } - return fmt.Sprintf("Bar_ArgWithParams_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParams_Args match the -// provided Bar_ArgWithParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Args match the +// provided Bar_ArgWithNestedQueryParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithParams_Args) Equals(rhs *Bar_ArgWithParams_Args) bool { +func (v *Bar_ArgWithNestedQueryParams_Args) Equals(rhs *Bar_ArgWithNestedQueryParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !(v.UUID == rhs.UUID) { + if !v.Request.Equals(rhs.Request) { return false } - if !((v.Params == nil && rhs.Params == nil) || (v.Params != nil && rhs.Params != nil && v.Params.Equals(rhs.Params))) { + if !((v.Opt == nil && rhs.Opt == nil) || (v.Opt != nil && rhs.Opt != nil && v.Opt.Equals(rhs.Opt))) { return false } @@ -6176,129 +5663,134 @@ func (v *Bar_ArgWithParams_Args) Equals(rhs *Bar_ArgWithParams_Args) bool { } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParams_Args. -func (v *Bar_ArgWithParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNestedQueryParams_Args. +func (v *Bar_ArgWithNestedQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - enc.AddString("uuid", v.UUID) - if v.Params != nil { - err = multierr.Append(err, enc.AddObject("params", v.Params)) + err = multierr.Append(err, enc.AddObject("request", v.Request)) + if v.Opt != nil { + err = multierr.Append(err, enc.AddObject("opt", v.Opt)) } return err } -// GetUUID returns the value of UUID if it is set or its +// GetRequest returns the value of Request if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParams_Args) GetUUID() (o string) { +func (v *Bar_ArgWithNestedQueryParams_Args) GetRequest() (o *QueryParamsStruct) { if v != nil { - o = v.UUID + o = v.Request } return } -// GetParams returns the value of Params if it is set or its +// IsSetRequest returns true if Request is not nil. +func (v *Bar_ArgWithNestedQueryParams_Args) IsSetRequest() bool { + return v != nil && v.Request != nil +} + +// GetOpt returns the value of Opt if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParams_Args) GetParams() (o *ParamsStruct) { - if v != nil && v.Params != nil { - return v.Params +func (v *Bar_ArgWithNestedQueryParams_Args) GetOpt() (o *QueryParamsOptsStruct) { + if v != nil && v.Opt != nil { + return v.Opt } return } -// IsSetParams returns true if Params is not nil. -func (v *Bar_ArgWithParams_Args) IsSetParams() bool { - return v != nil && v.Params != nil +// IsSetOpt returns true if Opt is not nil. +func (v *Bar_ArgWithNestedQueryParams_Args) IsSetOpt() bool { + return v != nil && v.Opt != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithParams" for this struct. -func (v *Bar_ArgWithParams_Args) MethodName() string { - return "argWithParams" +// This will always be "argWithNestedQueryParams" for this struct. +func (v *Bar_ArgWithNestedQueryParams_Args) MethodName() string { + return "argWithNestedQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNestedQueryParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithParams +// Bar_ArgWithNestedQueryParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithNestedQueryParams // function. -var Bar_ArgWithParams_Helper = struct { - // Args accepts the parameters of argWithParams in-order and returns +var Bar_ArgWithNestedQueryParams_Helper = struct { + // Args accepts the parameters of argWithNestedQueryParams in-order and returns // the arguments struct for the function. Args func( - uuid string, - params *ParamsStruct, - ) *Bar_ArgWithParams_Args + request *QueryParamsStruct, + opt *QueryParamsOptsStruct, + ) *Bar_ArgWithNestedQueryParams_Args // IsException returns true if the given error can be thrown - // by argWithParams. + // by argWithNestedQueryParams. // - // An error can be thrown by argWithParams only if the + // An error can be thrown by argWithNestedQueryParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithParams + // WrapResponse returns the result struct for argWithNestedQueryParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithParams into a serializable result struct. + // argWithNestedQueryParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithParams + // error cannot be thrown by argWithNestedQueryParams // - // value, err := argWithParams(args) - // result, err := Bar_ArgWithParams_Helper.WrapResponse(value, err) + // value, err := argWithNestedQueryParams(args) + // result, err := Bar_ArgWithNestedQueryParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithParams: %v", err) + // return fmt.Errorf("unexpected error from argWithNestedQueryParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithNestedQueryParams_Result, error) - // UnwrapResponse takes the result struct for argWithParams + // UnwrapResponse takes the result struct for argWithNestedQueryParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithParams threw an + // The error is non-nil only if argWithNestedQueryParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithNestedQueryParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithParams_Helper.Args = func( - uuid string, - params *ParamsStruct, - ) *Bar_ArgWithParams_Args { - return &Bar_ArgWithParams_Args{ - UUID: uuid, - Params: params, + Bar_ArgWithNestedQueryParams_Helper.Args = func( + request *QueryParamsStruct, + opt *QueryParamsOptsStruct, + ) *Bar_ArgWithNestedQueryParams_Args { + return &Bar_ArgWithNestedQueryParams_Args{ + Request: request, + Opt: opt, } } - Bar_ArgWithParams_Helper.IsException = func(err error) bool { + Bar_ArgWithNestedQueryParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParams_Result, error) { + Bar_ArgWithNestedQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithNestedQueryParams_Result, error) { if err == nil { - return &Bar_ArgWithParams_Result{Success: success}, nil + return &Bar_ArgWithNestedQueryParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithParams_Helper.UnwrapResponse = func(result *Bar_ArgWithParams_Result) (success *BarResponse, err error) { + Bar_ArgWithNestedQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithNestedQueryParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -6311,17 +5803,17 @@ func init() { } -// Bar_ArgWithParams_Result represents the result of a Bar.argWithParams function call. +// Bar_ArgWithNestedQueryParams_Result represents the result of a Bar.argWithNestedQueryParams function call. // -// The result of a argWithParams execution is sent and received over the wire as this struct. +// The result of a argWithNestedQueryParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithParams_Result struct { - // Value returned by argWithParams after a successful execution. +type Bar_ArgWithNestedQueryParams_Result struct { + // Value returned by argWithNestedQueryParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithNestedQueryParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6336,7 +5828,7 @@ type Bar_ArgWithParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithNestedQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -6354,17 +5846,17 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithNestedQueryParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithNestedQueryParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6372,12 +5864,12 @@ func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithParams_Result +// var v Bar_ArgWithNestedQueryParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithNestedQueryParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -6398,15 +5890,15 @@ func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithNestedQueryParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithParams_Result +// String returns a readable string representation of a Bar_ArgWithNestedQueryParams_Result // struct. -func (v *Bar_ArgWithParams_Result) String() string { +func (v *Bar_ArgWithNestedQueryParams_Result) String() string { if v == nil { return "" } @@ -6418,14 +5910,14 @@ func (v *Bar_ArgWithParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithNestedQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParams_Result match the -// provided Bar_ArgWithParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithNestedQueryParams_Result match the +// provided Bar_ArgWithNestedQueryParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithParams_Result) Equals(rhs *Bar_ArgWithParams_Result) bool { +func (v *Bar_ArgWithNestedQueryParams_Result) Equals(rhs *Bar_ArgWithNestedQueryParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -6439,8 +5931,8 @@ func (v *Bar_ArgWithParams_Result) Equals(rhs *Bar_ArgWithParams_Result) bool { } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParams_Result. -func (v *Bar_ArgWithParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithNestedQueryParams_Result. +func (v *Bar_ArgWithNestedQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -6452,7 +5944,7 @@ func (v *Bar_ArgWithParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) ( // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithNestedQueryParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -6461,34 +5953,34 @@ func (v *Bar_ArgWithParams_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithNestedQueryParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithParams" for this struct. -func (v *Bar_ArgWithParams_Result) MethodName() string { - return "argWithParams" +// This will always be "argWithNestedQueryParams" for this struct. +func (v *Bar_ArgWithNestedQueryParams_Result) MethodName() string { + return "argWithNestedQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithNestedQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithParamsAndDuplicateFields_Args represents the arguments for the Bar.argWithParamsAndDuplicateFields function. +// Bar_ArgWithParams_Args represents the arguments for the Bar.argWithParams function. // -// The arguments for argWithParamsAndDuplicateFields are sent and received over the wire as this struct. -type Bar_ArgWithParamsAndDuplicateFields_Args struct { - Request *RequestWithDuplicateType `json:"request,required"` - EntityUUID string `json:"entityUUID,required"` +// The arguments for argWithParams are sent and received over the wire as this struct. +type Bar_ArgWithParams_Args struct { + UUID string `json:"-"` + Params *ParamsStruct `json:"params,omitempty"` } -// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6503,7 +5995,7 @@ type Bar_ArgWithParamsAndDuplicateFields_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParams_Args) ToWire() (wire.Value, error) { var ( fields [2]wire.Field i int = 0 @@ -6511,37 +6003,35 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) err error ) - if v.Request == nil { - return w, errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") - } - w, err = v.Request.ToWire() + w, err = wire.NewValueString(v.UUID), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - - w, err = wire.NewValueString(v.EntityUUID), error(nil) - if err != nil { - return w, err + if v.Params != nil { + w, err = v.Params.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 2, Value: w} + i++ } - fields[i] = wire.Field{ID: 2, Value: w} - i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, error) { - var v RequestWithDuplicateType +func _ParamsStruct_Read(w wire.Value) (*ParamsStruct, error) { + var v ParamsStruct err := v.FromWire(w) return &v, err } -// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct +// An error is returned if we were unable to build a Bar_ArgWithParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6549,80 +6039,77 @@ func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, er // return nil, err // } // -// var v Bar_ArgWithParamsAndDuplicateFields_Args +// var v Bar_ArgWithParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParams_Args) FromWire(w wire.Value) error { var err error - requestIsSet := false - entityUUIDIsSet := false + uuidIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TStruct { - v.Request, err = _RequestWithDuplicateType_Read(field.Value) + if field.Value.Type() == wire.TBinary { + v.UUID, err = field.Value.GetString(), error(nil) if err != nil { return err } - requestIsSet = true + uuidIsSet = true } case 2: - if field.Value.Type() == wire.TBinary { - v.EntityUUID, err = field.Value.GetString(), error(nil) + if field.Value.Type() == wire.TStruct { + v.Params, err = _ParamsStruct_Read(field.Value) if err != nil { return err } - entityUUIDIsSet = true + } } } - if !requestIsSet { - return errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") - } - - if !entityUUIDIsSet { - return errors.New("field EntityUUID of Bar_ArgWithParamsAndDuplicateFields_Args is required") + if !uuidIsSet { + return errors.New("field UUID of Bar_ArgWithParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Args +// String returns a readable string representation of a Bar_ArgWithParams_Args // struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) String() string { +func (v *Bar_ArgWithParams_Args) String() string { if v == nil { return "" } var fields [2]string i := 0 - fields[i] = fmt.Sprintf("Request: %v", v.Request) - i++ - fields[i] = fmt.Sprintf("EntityUUID: %v", v.EntityUUID) + fields[i] = fmt.Sprintf("UUID: %v", v.UUID) i++ + if v.Params != nil { + fields[i] = fmt.Sprintf("Params: %v", v.Params) + i++ + } - return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParams_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Args match the -// provided Bar_ArgWithParamsAndDuplicateFields_Args. +// Equals returns true if all the fields of this Bar_ArgWithParams_Args match the +// provided Bar_ArgWithParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Args) bool { +func (v *Bar_ArgWithParams_Args) Equals(rhs *Bar_ArgWithParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !v.Request.Equals(rhs.Request) { + if !(v.UUID == rhs.UUID) { return false } - if !(v.EntityUUID == rhs.EntityUUID) { + if !((v.Params == nil && rhs.Params == nil) || (v.Params != nil && rhs.Params != nil && v.Params.Equals(rhs.Params))) { return false } @@ -6630,126 +6117,129 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Args) Equals(rhs *Bar_ArgWithParams } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParamsAndDuplicateFields_Args. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParams_Args. +func (v *Bar_ArgWithParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - err = multierr.Append(err, enc.AddObject("request", v.Request)) - enc.AddString("entityUUID", v.EntityUUID) + enc.AddString("uuid", v.UUID) + if v.Params != nil { + err = multierr.Append(err, enc.AddObject("params", v.Params)) + } return err } -// GetRequest returns the value of Request if it is set or its +// GetUUID returns the value of UUID if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetRequest() (o *RequestWithDuplicateType) { +func (v *Bar_ArgWithParams_Args) GetUUID() (o string) { if v != nil { - o = v.Request + o = v.UUID } return } -// IsSetRequest returns true if Request is not nil. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) IsSetRequest() bool { - return v != nil && v.Request != nil -} - -// GetEntityUUID returns the value of EntityUUID if it is set or its +// GetParams returns the value of Params if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetEntityUUID() (o string) { - if v != nil { - o = v.EntityUUID +func (v *Bar_ArgWithParams_Args) GetParams() (o *ParamsStruct) { + if v != nil && v.Params != nil { + return v.Params } + return } +// IsSetParams returns true if Params is not nil. +func (v *Bar_ArgWithParams_Args) IsSetParams() bool { + return v != nil && v.Params != nil +} + // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithParamsAndDuplicateFields" for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MethodName() string { - return "argWithParamsAndDuplicateFields" +// This will always be "argWithParams" for this struct. +func (v *Bar_ArgWithParams_Args) MethodName() string { + return "argWithParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithParamsAndDuplicateFields_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithParamsAndDuplicateFields +// Bar_ArgWithParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithParams // function. -var Bar_ArgWithParamsAndDuplicateFields_Helper = struct { - // Args accepts the parameters of argWithParamsAndDuplicateFields in-order and returns +var Bar_ArgWithParams_Helper = struct { + // Args accepts the parameters of argWithParams in-order and returns // the arguments struct for the function. Args func( - request *RequestWithDuplicateType, - entityUUID string, - ) *Bar_ArgWithParamsAndDuplicateFields_Args + uuid string, + params *ParamsStruct, + ) *Bar_ArgWithParams_Args // IsException returns true if the given error can be thrown - // by argWithParamsAndDuplicateFields. + // by argWithParams. // - // An error can be thrown by argWithParamsAndDuplicateFields only if the + // An error can be thrown by argWithParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithParamsAndDuplicateFields + // WrapResponse returns the result struct for argWithParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithParamsAndDuplicateFields into a serializable result struct. + // argWithParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithParamsAndDuplicateFields + // error cannot be thrown by argWithParams // - // value, err := argWithParamsAndDuplicateFields(args) - // result, err := Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse(value, err) + // value, err := argWithParams(args) + // result, err := Bar_ArgWithParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithParamsAndDuplicateFields: %v", err) + // return fmt.Errorf("unexpected error from argWithParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithParams_Result, error) - // UnwrapResponse takes the result struct for argWithParamsAndDuplicateFields + // UnwrapResponse takes the result struct for argWithParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithParamsAndDuplicateFields threw an + // The error is non-nil only if argWithParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithParamsAndDuplicateFields_Result) (*BarResponse, error) + // value, err := Bar_ArgWithParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithParamsAndDuplicateFields_Helper.Args = func( - request *RequestWithDuplicateType, - entityUUID string, - ) *Bar_ArgWithParamsAndDuplicateFields_Args { - return &Bar_ArgWithParamsAndDuplicateFields_Args{ - Request: request, - EntityUUID: entityUUID, + Bar_ArgWithParams_Helper.Args = func( + uuid string, + params *ParamsStruct, + ) *Bar_ArgWithParams_Args { + return &Bar_ArgWithParams_Args{ + UUID: uuid, + Params: params, } } - Bar_ArgWithParamsAndDuplicateFields_Helper.IsException = func(err error) bool { + Bar_ArgWithParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) { + Bar_ArgWithParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParams_Result, error) { if err == nil { - return &Bar_ArgWithParamsAndDuplicateFields_Result{Success: success}, nil + return &Bar_ArgWithParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse = func(result *Bar_ArgWithParamsAndDuplicateFields_Result) (success *BarResponse, err error) { + Bar_ArgWithParams_Helper.UnwrapResponse = func(result *Bar_ArgWithParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -6762,17 +6252,17 @@ func init() { } -// Bar_ArgWithParamsAndDuplicateFields_Result represents the result of a Bar.argWithParamsAndDuplicateFields function call. +// Bar_ArgWithParams_Result represents the result of a Bar.argWithParams function call. // -// The result of a argWithParamsAndDuplicateFields execution is sent and received over the wire as this struct. +// The result of a argWithParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithParamsAndDuplicateFields_Result struct { - // Value returned by argWithParamsAndDuplicateFields after a successful execution. +type Bar_ArgWithParams_Result struct { + // Value returned by argWithParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6787,7 +6277,7 @@ type Bar_ArgWithParamsAndDuplicateFields_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -6805,17 +6295,17 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct +// An error is returned if we were unable to build a Bar_ArgWithParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6823,12 +6313,12 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error // return nil, err // } // -// var v Bar_ArgWithParamsAndDuplicateFields_Result +// var v Bar_ArgWithParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -6849,15 +6339,15 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) erro count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Result +// String returns a readable string representation of a Bar_ArgWithParams_Result // struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) String() string { +func (v *Bar_ArgWithParams_Result) String() string { if v == nil { return "" } @@ -6869,14 +6359,14 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Result match the -// provided Bar_ArgWithParamsAndDuplicateFields_Result. +// Equals returns true if all the fields of this Bar_ArgWithParams_Result match the +// provided Bar_ArgWithParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Result) bool { +func (v *Bar_ArgWithParams_Result) Equals(rhs *Bar_ArgWithParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -6890,8 +6380,8 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) Equals(rhs *Bar_ArgWithPara } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithParamsAndDuplicateFields_Result. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParams_Result. +func (v *Bar_ArgWithParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -6903,7 +6393,7 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MarshalLogObject(enc zapcor // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -6912,33 +6402,34 @@ func (v *Bar_ArgWithParamsAndDuplicateFields_Result) GetSuccess() (o *BarRespons } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithParamsAndDuplicateFields" for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MethodName() string { - return "argWithParamsAndDuplicateFields" +// This will always be "argWithParams" for this struct. +func (v *Bar_ArgWithParams_Result) MethodName() string { + return "argWithParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithParamsAndDuplicateFields_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithQueryHeader_Args represents the arguments for the Bar.argWithQueryHeader function. +// Bar_ArgWithParamsAndDuplicateFields_Args represents the arguments for the Bar.argWithParamsAndDuplicateFields function. // -// The arguments for argWithQueryHeader are sent and received over the wire as this struct. -type Bar_ArgWithQueryHeader_Args struct { - UserUUID *string `json:"userUUID,omitempty"` +// The arguments for argWithParamsAndDuplicateFields are sent and received over the wire as this struct. +type Bar_ArgWithParamsAndDuplicateFields_Args struct { + Request *RequestWithDuplicateType `json:"request,required"` + EntityUUID string `json:"entityUUID,required"` } -// ToWire translates a Bar_ArgWithQueryHeader_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -6953,31 +6444,45 @@ type Bar_ArgWithQueryHeader_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) ToWire() (wire.Value, error) { var ( - fields [1]wire.Field + fields [2]wire.Field i int = 0 w wire.Value err error ) - if v.UserUUID != nil { - w, err = wire.NewValueString(*(v.UserUUID)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ + if v.Request == nil { + return w, errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") + } + w, err = v.Request.ToWire() + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 1, Value: w} + i++ + + w, err = wire.NewValueString(v.EntityUUID), error(nil) + if err != nil { + return w, err } + fields[i] = wire.Field{ID: 2, Value: w} + i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithQueryHeader_Args struct from its Thrift-level +func _RequestWithDuplicateType_Read(w wire.Value) (*RequestWithDuplicateType, error) { + var v RequestWithDuplicateType + err := v.FromWire(w) + return &v, err +} + +// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct +// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -6985,60 +6490,80 @@ func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithQueryHeader_Args +// var v Bar_ArgWithParamsAndDuplicateFields_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) FromWire(w wire.Value) error { var err error + requestIsSet := false + entityUUIDIsSet := false + for _, field := range w.GetStruct().Fields { switch field.ID { case 1: + if field.Value.Type() == wire.TStruct { + v.Request, err = _RequestWithDuplicateType_Read(field.Value) + if err != nil { + return err + } + requestIsSet = true + } + case 2: if field.Value.Type() == wire.TBinary { - var x string - x, err = field.Value.GetString(), error(nil) - v.UserUUID = &x + v.EntityUUID, err = field.Value.GetString(), error(nil) if err != nil { return err } - + entityUUIDIsSet = true } } } + if !requestIsSet { + return errors.New("field Request of Bar_ArgWithParamsAndDuplicateFields_Args is required") + } + + if !entityUUIDIsSet { + return errors.New("field EntityUUID of Bar_ArgWithParamsAndDuplicateFields_Args is required") + } + return nil } -// String returns a readable string representation of a Bar_ArgWithQueryHeader_Args +// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Args // struct. -func (v *Bar_ArgWithQueryHeader_Args) String() string { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) String() string { if v == nil { return "" } - var fields [1]string + var fields [2]string i := 0 - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } + fields[i] = fmt.Sprintf("Request: %v", v.Request) + i++ + fields[i] = fmt.Sprintf("EntityUUID: %v", v.EntityUUID) + i++ - return fmt.Sprintf("Bar_ArgWithQueryHeader_Args{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Args match the -// provided Bar_ArgWithQueryHeader_Args. +// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Args match the +// provided Bar_ArgWithParamsAndDuplicateFields_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryHeader_Args) Equals(rhs *Bar_ArgWithQueryHeader_Args) bool { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { + if !v.Request.Equals(rhs.Request) { + return false + } + if !(v.EntityUUID == rhs.EntityUUID) { return false } @@ -7046,116 +6571,126 @@ func (v *Bar_ArgWithQueryHeader_Args) Equals(rhs *Bar_ArgWithQueryHeader_Args) b } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryHeader_Args. -func (v *Bar_ArgWithQueryHeader_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParamsAndDuplicateFields_Args. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - if v.UserUUID != nil { - enc.AddString("userUUID", *v.UserUUID) - } + err = multierr.Append(err, enc.AddObject("request", v.Request)) + enc.AddString("entityUUID", v.EntityUUID) return err } -// GetUserUUID returns the value of UserUUID if it is set or its +// GetRequest returns the value of Request if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryHeader_Args) GetUserUUID() (o string) { - if v != nil && v.UserUUID != nil { - return *v.UserUUID +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetRequest() (o *RequestWithDuplicateType) { + if v != nil { + o = v.Request } - return } -// IsSetUserUUID returns true if UserUUID is not nil. -func (v *Bar_ArgWithQueryHeader_Args) IsSetUserUUID() bool { - return v != nil && v.UserUUID != nil +// IsSetRequest returns true if Request is not nil. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) IsSetRequest() bool { + return v != nil && v.Request != nil +} + +// GetEntityUUID returns the value of EntityUUID if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) GetEntityUUID() (o string) { + if v != nil { + o = v.EntityUUID + } + return } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithQueryHeader" for this struct. -func (v *Bar_ArgWithQueryHeader_Args) MethodName() string { - return "argWithQueryHeader" +// This will always be "argWithParamsAndDuplicateFields" for this struct. +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) MethodName() string { + return "argWithParamsAndDuplicateFields" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithQueryHeader_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParamsAndDuplicateFields_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithQueryHeader_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithQueryHeader +// Bar_ArgWithParamsAndDuplicateFields_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithParamsAndDuplicateFields // function. -var Bar_ArgWithQueryHeader_Helper = struct { - // Args accepts the parameters of argWithQueryHeader in-order and returns +var Bar_ArgWithParamsAndDuplicateFields_Helper = struct { + // Args accepts the parameters of argWithParamsAndDuplicateFields in-order and returns // the arguments struct for the function. Args func( - userUUID *string, - ) *Bar_ArgWithQueryHeader_Args + request *RequestWithDuplicateType, + entityUUID string, + ) *Bar_ArgWithParamsAndDuplicateFields_Args // IsException returns true if the given error can be thrown - // by argWithQueryHeader. + // by argWithParamsAndDuplicateFields. // - // An error can be thrown by argWithQueryHeader only if the + // An error can be thrown by argWithParamsAndDuplicateFields only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithQueryHeader + // WrapResponse returns the result struct for argWithParamsAndDuplicateFields // given its return value and error. // // This allows mapping values and errors returned by - // argWithQueryHeader into a serializable result struct. + // argWithParamsAndDuplicateFields into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithQueryHeader + // error cannot be thrown by argWithParamsAndDuplicateFields // - // value, err := argWithQueryHeader(args) - // result, err := Bar_ArgWithQueryHeader_Helper.WrapResponse(value, err) + // value, err := argWithParamsAndDuplicateFields(args) + // result, err := Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithQueryHeader: %v", err) + // return fmt.Errorf("unexpected error from argWithParamsAndDuplicateFields: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryHeader_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) - // UnwrapResponse takes the result struct for argWithQueryHeader + // UnwrapResponse takes the result struct for argWithParamsAndDuplicateFields // and returns the value or error returned by it. // - // The error is non-nil only if argWithQueryHeader threw an + // The error is non-nil only if argWithParamsAndDuplicateFields threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithQueryHeader_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithQueryHeader_Result) (*BarResponse, error) + // value, err := Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithParamsAndDuplicateFields_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithQueryHeader_Helper.Args = func( - userUUID *string, - ) *Bar_ArgWithQueryHeader_Args { - return &Bar_ArgWithQueryHeader_Args{ - UserUUID: userUUID, + Bar_ArgWithParamsAndDuplicateFields_Helper.Args = func( + request *RequestWithDuplicateType, + entityUUID string, + ) *Bar_ArgWithParamsAndDuplicateFields_Args { + return &Bar_ArgWithParamsAndDuplicateFields_Args{ + Request: request, + EntityUUID: entityUUID, } } - Bar_ArgWithQueryHeader_Helper.IsException = func(err error) bool { + Bar_ArgWithParamsAndDuplicateFields_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithQueryHeader_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryHeader_Result, error) { + Bar_ArgWithParamsAndDuplicateFields_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithParamsAndDuplicateFields_Result, error) { if err == nil { - return &Bar_ArgWithQueryHeader_Result{Success: success}, nil + return &Bar_ArgWithParamsAndDuplicateFields_Result{Success: success}, nil } return nil, err } - Bar_ArgWithQueryHeader_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryHeader_Result) (success *BarResponse, err error) { + Bar_ArgWithParamsAndDuplicateFields_Helper.UnwrapResponse = func(result *Bar_ArgWithParamsAndDuplicateFields_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -7168,17 +6703,17 @@ func init() { } -// Bar_ArgWithQueryHeader_Result represents the result of a Bar.argWithQueryHeader function call. +// Bar_ArgWithParamsAndDuplicateFields_Result represents the result of a Bar.argWithParamsAndDuplicateFields function call. // -// The result of a argWithQueryHeader execution is sent and received over the wire as this struct. +// The result of a argWithParamsAndDuplicateFields execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithQueryHeader_Result struct { - // Value returned by argWithQueryHeader after a successful execution. +type Bar_ArgWithParamsAndDuplicateFields_Result struct { + // Value returned by argWithParamsAndDuplicateFields after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithQueryHeader_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithParamsAndDuplicateFields_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7193,7 +6728,7 @@ type Bar_ArgWithQueryHeader_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -7211,17 +6746,17 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithQueryHeader_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithParamsAndDuplicateFields_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct +// An error is returned if we were unable to build a Bar_ArgWithParamsAndDuplicateFields_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7229,12 +6764,12 @@ func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithQueryHeader_Result +// var v Bar_ArgWithParamsAndDuplicateFields_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -7255,15 +6790,15 @@ func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithParamsAndDuplicateFields_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithQueryHeader_Result +// String returns a readable string representation of a Bar_ArgWithParamsAndDuplicateFields_Result // struct. -func (v *Bar_ArgWithQueryHeader_Result) String() string { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) String() string { if v == nil { return "" } @@ -7275,14 +6810,14 @@ func (v *Bar_ArgWithQueryHeader_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithQueryHeader_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithParamsAndDuplicateFields_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Result match the -// provided Bar_ArgWithQueryHeader_Result. +// Equals returns true if all the fields of this Bar_ArgWithParamsAndDuplicateFields_Result match the +// provided Bar_ArgWithParamsAndDuplicateFields_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryHeader_Result) Equals(rhs *Bar_ArgWithQueryHeader_Result) bool { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) Equals(rhs *Bar_ArgWithParamsAndDuplicateFields_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -7296,8 +6831,8 @@ func (v *Bar_ArgWithQueryHeader_Result) Equals(rhs *Bar_ArgWithQueryHeader_Resul } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryHeader_Result. -func (v *Bar_ArgWithQueryHeader_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithParamsAndDuplicateFields_Result. +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -7309,7 +6844,7 @@ func (v *Bar_ArgWithQueryHeader_Result) MarshalLogObject(enc zapcore.ObjectEncod // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryHeader_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -7318,62 +6853,33 @@ func (v *Bar_ArgWithQueryHeader_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithQueryHeader_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithQueryHeader" for this struct. -func (v *Bar_ArgWithQueryHeader_Result) MethodName() string { - return "argWithQueryHeader" +// This will always be "argWithParamsAndDuplicateFields" for this struct. +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) MethodName() string { + return "argWithParamsAndDuplicateFields" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithQueryHeader_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithParamsAndDuplicateFields_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithQueryParams_Args represents the arguments for the Bar.argWithQueryParams function. +// Bar_ArgWithQueryHeader_Args represents the arguments for the Bar.argWithQueryHeader function. // -// The arguments for argWithQueryParams are sent and received over the wire as this struct. -type Bar_ArgWithQueryParams_Args struct { - Name string `json:"name,required"` - UserUUID *string `json:"userUUID,omitempty"` - Foo []string `json:"foo,omitempty"` - Bar []int8 `json:"bar,required"` -} - -type _List_Byte_ValueList []int8 - -func (v _List_Byte_ValueList) ForEach(f func(wire.Value) error) error { - for _, x := range v { - w, err := wire.NewValueI8(x), error(nil) - if err != nil { - return err - } - err = f(w) - if err != nil { - return err - } - } - return nil -} - -func (v _List_Byte_ValueList) Size() int { - return len(v) -} - -func (_List_Byte_ValueList) ValueType() wire.Type { - return wire.TI8 +// The arguments for argWithQueryHeader are sent and received over the wire as this struct. +type Bar_ArgWithQueryHeader_Args struct { + UserUUID *string `json:"userUUID,omitempty"` } -func (_List_Byte_ValueList) Close() {} - -// ToWire translates a Bar_ArgWithQueryParams_Args struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithQueryHeader_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7388,72 +6894,31 @@ func (_List_Byte_ValueList) Close() {} // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryHeader_Args) ToWire() (wire.Value, error) { var ( - fields [4]wire.Field + fields [1]wire.Field i int = 0 w wire.Value err error ) - w, err = wire.NewValueString(v.Name), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 1, Value: w} - i++ if v.UserUUID != nil { w, err = wire.NewValueString(*(v.UserUUID)), error(nil) if err != nil { return w, err } - fields[i] = wire.Field{ID: 2, Value: w} - i++ - } - if v.Foo != nil { - w, err = wire.NewValueList(_List_String_ValueList(v.Foo)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 3, Value: w} + fields[i] = wire.Field{ID: 1, Value: w} i++ } - if v.Bar == nil { - return w, errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") - } - w, err = wire.NewValueList(_List_Byte_ValueList(v.Bar)), error(nil) - if err != nil { - return w, err - } - fields[i] = wire.Field{ID: 4, Value: w} - i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _List_Byte_Read(l wire.ValueList) ([]int8, error) { - if l.ValueType() != wire.TI8 { - return nil, nil - } - - o := make([]int8, 0, l.Size()) - err := l.ForEach(func(x wire.Value) error { - i, err := x.GetI8(), error(nil) - if err != nil { - return err - } - o = append(o, i) - return nil - }) - l.Close() - return o, err -} - -// FromWire deserializes a Bar_ArgWithQueryParams_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryHeader_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7461,29 +6926,17 @@ func _List_Byte_Read(l wire.ValueList) ([]int8, error) { // return nil, err // } // -// var v Bar_ArgWithQueryParams_Args +// var v Bar_ArgWithQueryHeader_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryHeader_Args) FromWire(w wire.Value) error { var err error - nameIsSet := false - - barIsSet := false - for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TBinary { - v.Name, err = field.Value.GetString(), error(nil) - if err != nil { - return err - } - nameIsSet = true - } - case 2: if field.Value.Type() == wire.TBinary { var x string x, err = field.Value.GetString(), error(nil) @@ -7493,142 +6946,61 @@ func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { } } - case 3: - if field.Value.Type() == wire.TList { - v.Foo, err = _List_String_Read(field.Value.GetList()) - if err != nil { - return err - } - - } - case 4: - if field.Value.Type() == wire.TList { - v.Bar, err = _List_Byte_Read(field.Value.GetList()) - if err != nil { - return err - } - barIsSet = true - } } } - if !nameIsSet { - return errors.New("field Name of Bar_ArgWithQueryParams_Args is required") - } - - if !barIsSet { - return errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") - } - return nil } -// String returns a readable string representation of a Bar_ArgWithQueryParams_Args +// String returns a readable string representation of a Bar_ArgWithQueryHeader_Args // struct. -func (v *Bar_ArgWithQueryParams_Args) String() string { +func (v *Bar_ArgWithQueryHeader_Args) String() string { if v == nil { return "" } - - var fields [4]string - i := 0 - fields[i] = fmt.Sprintf("Name: %v", v.Name) - i++ - if v.UserUUID != nil { - fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) - i++ - } - if v.Foo != nil { - fields[i] = fmt.Sprintf("Foo: %v", v.Foo) - i++ - } - fields[i] = fmt.Sprintf("Bar: %v", v.Bar) - i++ - - return fmt.Sprintf("Bar_ArgWithQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) -} - -func _List_Byte_Equals(lhs, rhs []int8) bool { - if len(lhs) != len(rhs) { - return false - } - - for i, lv := range lhs { - rv := rhs[i] - if !(lv == rv) { - return false - } + + var fields [1]string + i := 0 + if v.UserUUID != nil { + fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) + i++ } - return true + return fmt.Sprintf("Bar_ArgWithQueryHeader_Args{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Args match the -// provided Bar_ArgWithQueryParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Args match the +// provided Bar_ArgWithQueryHeader_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryParams_Args) Equals(rhs *Bar_ArgWithQueryParams_Args) bool { +func (v *Bar_ArgWithQueryHeader_Args) Equals(rhs *Bar_ArgWithQueryHeader_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !(v.Name == rhs.Name) { - return false - } if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { return false } - if !((v.Foo == nil && rhs.Foo == nil) || (v.Foo != nil && rhs.Foo != nil && _List_String_Equals(v.Foo, rhs.Foo))) { - return false - } - if !_List_Byte_Equals(v.Bar, rhs.Bar) { - return false - } return true } -type _List_Byte_Zapper []int8 - -// MarshalLogArray implements zapcore.ArrayMarshaler, enabling -// fast logging of _List_Byte_Zapper. -func (l _List_Byte_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) { - for _, v := range l { - enc.AppendInt8(v) - } - return err -} - // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryParams_Args. -func (v *Bar_ArgWithQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryHeader_Args. +func (v *Bar_ArgWithQueryHeader_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - enc.AddString("name", v.Name) if v.UserUUID != nil { enc.AddString("userUUID", *v.UserUUID) } - if v.Foo != nil { - err = multierr.Append(err, enc.AddArray("foo", (_List_String_Zapper)(v.Foo))) - } - err = multierr.Append(err, enc.AddArray("bar", (_List_Byte_Zapper)(v.Bar))) return err } -// GetName returns the value of Name if it is set or its -// zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetName() (o string) { - if v != nil { - o = v.Name - } - return -} - // GetUserUUID returns the value of UserUUID if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetUserUUID() (o string) { +func (v *Bar_ArgWithQueryHeader_Args) GetUserUUID() (o string) { if v != nil && v.UserUUID != nil { return *v.UserUUID } @@ -7637,132 +7009,94 @@ func (v *Bar_ArgWithQueryParams_Args) GetUserUUID() (o string) { } // IsSetUserUUID returns true if UserUUID is not nil. -func (v *Bar_ArgWithQueryParams_Args) IsSetUserUUID() bool { +func (v *Bar_ArgWithQueryHeader_Args) IsSetUserUUID() bool { return v != nil && v.UserUUID != nil } -// GetFoo returns the value of Foo if it is set or its -// zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetFoo() (o []string) { - if v != nil && v.Foo != nil { - return v.Foo - } - - return -} - -// IsSetFoo returns true if Foo is not nil. -func (v *Bar_ArgWithQueryParams_Args) IsSetFoo() bool { - return v != nil && v.Foo != nil -} - -// GetBar returns the value of Bar if it is set or its -// zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Args) GetBar() (o []int8) { - if v != nil { - o = v.Bar - } - return -} - -// IsSetBar returns true if Bar is not nil. -func (v *Bar_ArgWithQueryParams_Args) IsSetBar() bool { - return v != nil && v.Bar != nil -} - // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithQueryParams" for this struct. -func (v *Bar_ArgWithQueryParams_Args) MethodName() string { - return "argWithQueryParams" +// This will always be "argWithQueryHeader" for this struct. +func (v *Bar_ArgWithQueryHeader_Args) MethodName() string { + return "argWithQueryHeader" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithQueryParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryHeader_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithQueryParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithQueryParams +// Bar_ArgWithQueryHeader_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithQueryHeader // function. -var Bar_ArgWithQueryParams_Helper = struct { - // Args accepts the parameters of argWithQueryParams in-order and returns +var Bar_ArgWithQueryHeader_Helper = struct { + // Args accepts the parameters of argWithQueryHeader in-order and returns // the arguments struct for the function. Args func( - name string, userUUID *string, - foo []string, - bar []int8, - ) *Bar_ArgWithQueryParams_Args + ) *Bar_ArgWithQueryHeader_Args // IsException returns true if the given error can be thrown - // by argWithQueryParams. + // by argWithQueryHeader. // - // An error can be thrown by argWithQueryParams only if the + // An error can be thrown by argWithQueryHeader only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithQueryParams + // WrapResponse returns the result struct for argWithQueryHeader // given its return value and error. // // This allows mapping values and errors returned by - // argWithQueryParams into a serializable result struct. + // argWithQueryHeader into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithQueryParams + // error cannot be thrown by argWithQueryHeader // - // value, err := argWithQueryParams(args) - // result, err := Bar_ArgWithQueryParams_Helper.WrapResponse(value, err) + // value, err := argWithQueryHeader(args) + // result, err := Bar_ArgWithQueryHeader_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithQueryParams: %v", err) + // return fmt.Errorf("unexpected error from argWithQueryHeader: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryHeader_Result, error) - // UnwrapResponse takes the result struct for argWithQueryParams + // UnwrapResponse takes the result struct for argWithQueryHeader // and returns the value or error returned by it. // - // The error is non-nil only if argWithQueryParams threw an + // The error is non-nil only if argWithQueryHeader threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithQueryParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithQueryParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithQueryHeader_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithQueryHeader_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithQueryParams_Helper.Args = func( - name string, + Bar_ArgWithQueryHeader_Helper.Args = func( userUUID *string, - foo []string, - bar []int8, - ) *Bar_ArgWithQueryParams_Args { - return &Bar_ArgWithQueryParams_Args{ - Name: name, + ) *Bar_ArgWithQueryHeader_Args { + return &Bar_ArgWithQueryHeader_Args{ UserUUID: userUUID, - Foo: foo, - Bar: bar, } } - Bar_ArgWithQueryParams_Helper.IsException = func(err error) bool { + Bar_ArgWithQueryHeader_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryParams_Result, error) { + Bar_ArgWithQueryHeader_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryHeader_Result, error) { if err == nil { - return &Bar_ArgWithQueryParams_Result{Success: success}, nil + return &Bar_ArgWithQueryHeader_Result{Success: success}, nil } return nil, err } - Bar_ArgWithQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryParams_Result) (success *BarResponse, err error) { + Bar_ArgWithQueryHeader_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryHeader_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -7775,17 +7109,17 @@ func init() { } -// Bar_ArgWithQueryParams_Result represents the result of a Bar.argWithQueryParams function call. +// Bar_ArgWithQueryHeader_Result represents the result of a Bar.argWithQueryHeader function call. // -// The result of a argWithQueryParams execution is sent and received over the wire as this struct. +// The result of a argWithQueryHeader execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithQueryParams_Result struct { - // Value returned by argWithQueryParams after a successful execution. +type Bar_ArgWithQueryHeader_Result struct { + // Value returned by argWithQueryHeader after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithQueryParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithQueryHeader_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7800,7 +7134,7 @@ type Bar_ArgWithQueryParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryHeader_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -7818,17 +7152,17 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithQueryParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryHeader_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithQueryHeader_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -7836,12 +7170,12 @@ func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { // return nil, err // } // -// var v Bar_ArgWithQueryParams_Result +// var v Bar_ArgWithQueryHeader_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryHeader_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -7862,15 +7196,15 @@ func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithQueryHeader_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithQueryParams_Result +// String returns a readable string representation of a Bar_ArgWithQueryHeader_Result // struct. -func (v *Bar_ArgWithQueryParams_Result) String() string { +func (v *Bar_ArgWithQueryHeader_Result) String() string { if v == nil { return "" } @@ -7882,14 +7216,14 @@ func (v *Bar_ArgWithQueryParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithQueryHeader_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Result match the -// provided Bar_ArgWithQueryParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithQueryHeader_Result match the +// provided Bar_ArgWithQueryHeader_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithQueryParams_Result) Equals(rhs *Bar_ArgWithQueryParams_Result) bool { +func (v *Bar_ArgWithQueryHeader_Result) Equals(rhs *Bar_ArgWithQueryHeader_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -7903,8 +7237,8 @@ func (v *Bar_ArgWithQueryParams_Result) Equals(rhs *Bar_ArgWithQueryParams_Resul } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithQueryParams_Result. -func (v *Bar_ArgWithQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryHeader_Result. +func (v *Bar_ArgWithQueryHeader_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -7916,7 +7250,7 @@ func (v *Bar_ArgWithQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncod // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithQueryParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithQueryHeader_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -7925,34 +7259,62 @@ func (v *Bar_ArgWithQueryParams_Result) GetSuccess() (o *BarResponse) { } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithQueryParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithQueryHeader_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithQueryParams" for this struct. -func (v *Bar_ArgWithQueryParams_Result) MethodName() string { - return "argWithQueryParams" +// This will always be "argWithQueryHeader" for this struct. +func (v *Bar_ArgWithQueryHeader_Result) MethodName() string { + return "argWithQueryHeader" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithQueryParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryHeader_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } -// Bar_ArgWithUntaggedNestedQueryParams_Args represents the arguments for the Bar.argWithUntaggedNestedQueryParams function. +// Bar_ArgWithQueryParams_Args represents the arguments for the Bar.argWithQueryParams function. // -// The arguments for argWithUntaggedNestedQueryParams are sent and received over the wire as this struct. -type Bar_ArgWithUntaggedNestedQueryParams_Args struct { - Request *QueryParamsUntaggedStruct `json:"request,required"` - Opt *QueryParamsUntaggedOptStruct `json:"opt,omitempty"` +// The arguments for argWithQueryParams are sent and received over the wire as this struct. +type Bar_ArgWithQueryParams_Args struct { + Name string `json:"name,required"` + UserUUID *string `json:"userUUID,omitempty"` + Foo []string `json:"foo,omitempty"` + Bar []int8 `json:"bar,required"` +} + +type _List_Byte_ValueList []int8 + +func (v _List_Byte_ValueList) ForEach(f func(wire.Value) error) error { + for _, x := range v { + w, err := wire.NewValueI8(x), error(nil) + if err != nil { + return err + } + err = f(w) + if err != nil { + return err + } + } + return nil +} + +func (v _List_Byte_ValueList) Size() int { + return len(v) +} + +func (_List_Byte_ValueList) ValueType() wire.Type { + return wire.TI8 } -// ToWire translates a Bar_ArgWithUntaggedNestedQueryParams_Args struct into a Thrift-level intermediate +func (_List_Byte_ValueList) Close() {} + +// ToWire translates a Bar_ArgWithQueryParams_Args struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -7967,52 +7329,72 @@ type Bar_ArgWithUntaggedNestedQueryParams_Args struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryParams_Args) ToWire() (wire.Value, error) { var ( - fields [2]wire.Field + fields [4]wire.Field i int = 0 w wire.Value err error ) - if v.Request == nil { - return w, errors.New("field Request of Bar_ArgWithUntaggedNestedQueryParams_Args is required") - } - w, err = v.Request.ToWire() + w, err = wire.NewValueString(v.Name), error(nil) if err != nil { return w, err } fields[i] = wire.Field{ID: 1, Value: w} i++ - if v.Opt != nil { - w, err = v.Opt.ToWire() + if v.UserUUID != nil { + w, err = wire.NewValueString(*(v.UserUUID)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 2, Value: w} + i++ + } + if v.Foo != nil { + w, err = wire.NewValueList(_List_String_ValueList(v.Foo)), error(nil) if err != nil { return w, err } - fields[i] = wire.Field{ID: 2, Value: w} + fields[i] = wire.Field{ID: 3, Value: w} i++ } + if v.Bar == nil { + return w, errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") + } + w, err = wire.NewValueList(_List_Byte_ValueList(v.Bar)), error(nil) + if err != nil { + return w, err + } + fields[i] = wire.Field{ID: 4, Value: w} + i++ return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -func _QueryParamsUntaggedStruct_Read(w wire.Value) (*QueryParamsUntaggedStruct, error) { - var v QueryParamsUntaggedStruct - err := v.FromWire(w) - return &v, err -} +func _List_Byte_Read(l wire.ValueList) ([]int8, error) { + if l.ValueType() != wire.TI8 { + return nil, nil + } -func _QueryParamsUntaggedOptStruct_Read(w wire.Value) (*QueryParamsUntaggedOptStruct, error) { - var v QueryParamsUntaggedOptStruct - err := v.FromWire(w) - return &v, err + o := make([]int8, 0, l.Size()) + err := l.ForEach(func(x wire.Value) error { + i, err := x.GetI8(), error(nil) + if err != nil { + return err + } + o = append(o, i) + return nil + }) + l.Close() + return o, err } -// FromWire deserializes a Bar_ArgWithUntaggedNestedQueryParams_Args struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryParams_Args struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithUntaggedNestedQueryParams_Args struct +// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Args struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -8020,212 +7402,308 @@ func _QueryParamsUntaggedOptStruct_Read(w wire.Value) (*QueryParamsUntaggedOptSt // return nil, err // } // -// var v Bar_ArgWithUntaggedNestedQueryParams_Args +// var v Bar_ArgWithQueryParams_Args // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryParams_Args) FromWire(w wire.Value) error { var err error - requestIsSet := false + nameIsSet := false + + barIsSet := false for _, field := range w.GetStruct().Fields { switch field.ID { case 1: - if field.Value.Type() == wire.TStruct { - v.Request, err = _QueryParamsUntaggedStruct_Read(field.Value) + if field.Value.Type() == wire.TBinary { + v.Name, err = field.Value.GetString(), error(nil) if err != nil { return err } - requestIsSet = true + nameIsSet = true } case 2: - if field.Value.Type() == wire.TStruct { - v.Opt, err = _QueryParamsUntaggedOptStruct_Read(field.Value) + if field.Value.Type() == wire.TBinary { + var x string + x, err = field.Value.GetString(), error(nil) + v.UserUUID = &x + if err != nil { + return err + } + + } + case 3: + if field.Value.Type() == wire.TList { + v.Foo, err = _List_String_Read(field.Value.GetList()) if err != nil { return err } } + case 4: + if field.Value.Type() == wire.TList { + v.Bar, err = _List_Byte_Read(field.Value.GetList()) + if err != nil { + return err + } + barIsSet = true + } } } - if !requestIsSet { - return errors.New("field Request of Bar_ArgWithUntaggedNestedQueryParams_Args is required") + if !nameIsSet { + return errors.New("field Name of Bar_ArgWithQueryParams_Args is required") + } + + if !barIsSet { + return errors.New("field Bar of Bar_ArgWithQueryParams_Args is required") } return nil } -// String returns a readable string representation of a Bar_ArgWithUntaggedNestedQueryParams_Args +// String returns a readable string representation of a Bar_ArgWithQueryParams_Args // struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) String() string { +func (v *Bar_ArgWithQueryParams_Args) String() string { if v == nil { return "" } - var fields [2]string + var fields [4]string i := 0 - fields[i] = fmt.Sprintf("Request: %v", v.Request) + fields[i] = fmt.Sprintf("Name: %v", v.Name) i++ - if v.Opt != nil { - fields[i] = fmt.Sprintf("Opt: %v", v.Opt) + if v.UserUUID != nil { + fields[i] = fmt.Sprintf("UserUUID: %v", *(v.UserUUID)) + i++ + } + if v.Foo != nil { + fields[i] = fmt.Sprintf("Foo: %v", v.Foo) i++ } + fields[i] = fmt.Sprintf("Bar: %v", v.Bar) + i++ + + return fmt.Sprintf("Bar_ArgWithQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) +} + +func _List_Byte_Equals(lhs, rhs []int8) bool { + if len(lhs) != len(rhs) { + return false + } + + for i, lv := range lhs { + rv := rhs[i] + if !(lv == rv) { + return false + } + } - return fmt.Sprintf("Bar_ArgWithUntaggedNestedQueryParams_Args{%v}", strings.Join(fields[:i], ", ")) + return true } -// Equals returns true if all the fields of this Bar_ArgWithUntaggedNestedQueryParams_Args match the -// provided Bar_ArgWithUntaggedNestedQueryParams_Args. +// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Args match the +// provided Bar_ArgWithQueryParams_Args. // // This function performs a deep comparison. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) Equals(rhs *Bar_ArgWithUntaggedNestedQueryParams_Args) bool { +func (v *Bar_ArgWithQueryParams_Args) Equals(rhs *Bar_ArgWithQueryParams_Args) bool { if v == nil { return rhs == nil } else if rhs == nil { return false } - if !v.Request.Equals(rhs.Request) { + if !(v.Name == rhs.Name) { return false } - if !((v.Opt == nil && rhs.Opt == nil) || (v.Opt != nil && rhs.Opt != nil && v.Opt.Equals(rhs.Opt))) { + if !_String_EqualsPtr(v.UserUUID, rhs.UserUUID) { + return false + } + if !((v.Foo == nil && rhs.Foo == nil) || (v.Foo != nil && rhs.Foo != nil && _List_String_Equals(v.Foo, rhs.Foo))) { + return false + } + if !_List_Byte_Equals(v.Bar, rhs.Bar) { return false } return true } +type _List_Byte_Zapper []int8 + +// MarshalLogArray implements zapcore.ArrayMarshaler, enabling +// fast logging of _List_Byte_Zapper. +func (l _List_Byte_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) { + for _, v := range l { + enc.AppendInt8(v) + } + return err +} + // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithUntaggedNestedQueryParams_Args. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryParams_Args. +func (v *Bar_ArgWithQueryParams_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } - err = multierr.Append(err, enc.AddObject("request", v.Request)) - if v.Opt != nil { - err = multierr.Append(err, enc.AddObject("opt", v.Opt)) + enc.AddString("name", v.Name) + if v.UserUUID != nil { + enc.AddString("userUUID", *v.UserUUID) + } + if v.Foo != nil { + err = multierr.Append(err, enc.AddArray("foo", (_List_String_Zapper)(v.Foo))) } + err = multierr.Append(err, enc.AddArray("bar", (_List_Byte_Zapper)(v.Bar))) return err } -// GetRequest returns the value of Request if it is set or its +// GetName returns the value of Name if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) GetRequest() (o *QueryParamsUntaggedStruct) { +func (v *Bar_ArgWithQueryParams_Args) GetName() (o string) { if v != nil { - o = v.Request + o = v.Name } return } -// IsSetRequest returns true if Request is not nil. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) IsSetRequest() bool { - return v != nil && v.Request != nil +// GetUserUUID returns the value of UserUUID if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithQueryParams_Args) GetUserUUID() (o string) { + if v != nil && v.UserUUID != nil { + return *v.UserUUID + } + + return } -// GetOpt returns the value of Opt if it is set or its +// IsSetUserUUID returns true if UserUUID is not nil. +func (v *Bar_ArgWithQueryParams_Args) IsSetUserUUID() bool { + return v != nil && v.UserUUID != nil +} + +// GetFoo returns the value of Foo if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) GetOpt() (o *QueryParamsUntaggedOptStruct) { - if v != nil && v.Opt != nil { - return v.Opt +func (v *Bar_ArgWithQueryParams_Args) GetFoo() (o []string) { + if v != nil && v.Foo != nil { + return v.Foo } return } -// IsSetOpt returns true if Opt is not nil. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) IsSetOpt() bool { - return v != nil && v.Opt != nil +// IsSetFoo returns true if Foo is not nil. +func (v *Bar_ArgWithQueryParams_Args) IsSetFoo() bool { + return v != nil && v.Foo != nil +} + +// GetBar returns the value of Bar if it is set or its +// zero value if it is unset. +func (v *Bar_ArgWithQueryParams_Args) GetBar() (o []int8) { + if v != nil { + o = v.Bar + } + return +} + +// IsSetBar returns true if Bar is not nil. +func (v *Bar_ArgWithQueryParams_Args) IsSetBar() bool { + return v != nil && v.Bar != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the arguments. // -// This will always be "argWithUntaggedNestedQueryParams" for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) MethodName() string { - return "argWithUntaggedNestedQueryParams" +// This will always be "argWithQueryParams" for this struct. +func (v *Bar_ArgWithQueryParams_Args) MethodName() string { + return "argWithQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Call for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryParams_Args) EnvelopeType() wire.EnvelopeType { return wire.Call } -// Bar_ArgWithUntaggedNestedQueryParams_Helper provides functions that aid in handling the -// parameters and return values of the Bar.argWithUntaggedNestedQueryParams +// Bar_ArgWithQueryParams_Helper provides functions that aid in handling the +// parameters and return values of the Bar.argWithQueryParams // function. -var Bar_ArgWithUntaggedNestedQueryParams_Helper = struct { - // Args accepts the parameters of argWithUntaggedNestedQueryParams in-order and returns +var Bar_ArgWithQueryParams_Helper = struct { + // Args accepts the parameters of argWithQueryParams in-order and returns // the arguments struct for the function. Args func( - request *QueryParamsUntaggedStruct, - opt *QueryParamsUntaggedOptStruct, - ) *Bar_ArgWithUntaggedNestedQueryParams_Args + name string, + userUUID *string, + foo []string, + bar []int8, + ) *Bar_ArgWithQueryParams_Args // IsException returns true if the given error can be thrown - // by argWithUntaggedNestedQueryParams. + // by argWithQueryParams. // - // An error can be thrown by argWithUntaggedNestedQueryParams only if the + // An error can be thrown by argWithQueryParams only if the // corresponding exception type was mentioned in the 'throws' // section for it in the Thrift file. IsException func(error) bool - // WrapResponse returns the result struct for argWithUntaggedNestedQueryParams + // WrapResponse returns the result struct for argWithQueryParams // given its return value and error. // // This allows mapping values and errors returned by - // argWithUntaggedNestedQueryParams into a serializable result struct. + // argWithQueryParams into a serializable result struct. // WrapResponse returns a non-nil error if the provided - // error cannot be thrown by argWithUntaggedNestedQueryParams + // error cannot be thrown by argWithQueryParams // - // value, err := argWithUntaggedNestedQueryParams(args) - // result, err := Bar_ArgWithUntaggedNestedQueryParams_Helper.WrapResponse(value, err) + // value, err := argWithQueryParams(args) + // result, err := Bar_ArgWithQueryParams_Helper.WrapResponse(value, err) // if err != nil { - // return fmt.Errorf("unexpected error from argWithUntaggedNestedQueryParams: %v", err) + // return fmt.Errorf("unexpected error from argWithQueryParams: %v", err) // } // serialize(result) - WrapResponse func(*BarResponse, error) (*Bar_ArgWithUntaggedNestedQueryParams_Result, error) + WrapResponse func(*BarResponse, error) (*Bar_ArgWithQueryParams_Result, error) - // UnwrapResponse takes the result struct for argWithUntaggedNestedQueryParams + // UnwrapResponse takes the result struct for argWithQueryParams // and returns the value or error returned by it. // - // The error is non-nil only if argWithUntaggedNestedQueryParams threw an + // The error is non-nil only if argWithQueryParams threw an // exception. // // result := deserialize(bytes) - // value, err := Bar_ArgWithUntaggedNestedQueryParams_Helper.UnwrapResponse(result) - UnwrapResponse func(*Bar_ArgWithUntaggedNestedQueryParams_Result) (*BarResponse, error) + // value, err := Bar_ArgWithQueryParams_Helper.UnwrapResponse(result) + UnwrapResponse func(*Bar_ArgWithQueryParams_Result) (*BarResponse, error) }{} func init() { - Bar_ArgWithUntaggedNestedQueryParams_Helper.Args = func( - request *QueryParamsUntaggedStruct, - opt *QueryParamsUntaggedOptStruct, - ) *Bar_ArgWithUntaggedNestedQueryParams_Args { - return &Bar_ArgWithUntaggedNestedQueryParams_Args{ - Request: request, - Opt: opt, + Bar_ArgWithQueryParams_Helper.Args = func( + name string, + userUUID *string, + foo []string, + bar []int8, + ) *Bar_ArgWithQueryParams_Args { + return &Bar_ArgWithQueryParams_Args{ + Name: name, + UserUUID: userUUID, + Foo: foo, + Bar: bar, } } - Bar_ArgWithUntaggedNestedQueryParams_Helper.IsException = func(err error) bool { + Bar_ArgWithQueryParams_Helper.IsException = func(err error) bool { switch err.(type) { default: return false } } - Bar_ArgWithUntaggedNestedQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithUntaggedNestedQueryParams_Result, error) { + Bar_ArgWithQueryParams_Helper.WrapResponse = func(success *BarResponse, err error) (*Bar_ArgWithQueryParams_Result, error) { if err == nil { - return &Bar_ArgWithUntaggedNestedQueryParams_Result{Success: success}, nil + return &Bar_ArgWithQueryParams_Result{Success: success}, nil } return nil, err } - Bar_ArgWithUntaggedNestedQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithUntaggedNestedQueryParams_Result) (success *BarResponse, err error) { + Bar_ArgWithQueryParams_Helper.UnwrapResponse = func(result *Bar_ArgWithQueryParams_Result) (success *BarResponse, err error) { if result.Success != nil { success = result.Success @@ -8238,17 +7716,17 @@ func init() { } -// Bar_ArgWithUntaggedNestedQueryParams_Result represents the result of a Bar.argWithUntaggedNestedQueryParams function call. +// Bar_ArgWithQueryParams_Result represents the result of a Bar.argWithQueryParams function call. // -// The result of a argWithUntaggedNestedQueryParams execution is sent and received over the wire as this struct. +// The result of a argWithQueryParams execution is sent and received over the wire as this struct. // // Success is set only if the function did not throw an exception. -type Bar_ArgWithUntaggedNestedQueryParams_Result struct { - // Value returned by argWithUntaggedNestedQueryParams after a successful execution. +type Bar_ArgWithQueryParams_Result struct { + // Value returned by argWithQueryParams after a successful execution. Success *BarResponse `json:"success,omitempty"` } -// ToWire translates a Bar_ArgWithUntaggedNestedQueryParams_Result struct into a Thrift-level intermediate +// ToWire translates a Bar_ArgWithQueryParams_Result struct into a Thrift-level intermediate // representation. This intermediate representation may be serialized // into bytes using a ThriftRW protocol implementation. // @@ -8263,7 +7741,7 @@ type Bar_ArgWithUntaggedNestedQueryParams_Result struct { // if err := binaryProtocol.Encode(x, writer); err != nil { // return err // } -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) ToWire() (wire.Value, error) { +func (v *Bar_ArgWithQueryParams_Result) ToWire() (wire.Value, error) { var ( fields [1]wire.Field i int = 0 @@ -8281,17 +7759,17 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) ToWire() (wire.Value, erro } if i != 1 { - return wire.Value{}, fmt.Errorf("Bar_ArgWithUntaggedNestedQueryParams_Result should have exactly one field: got %v fields", i) + return wire.Value{}, fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", i) } return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil } -// FromWire deserializes a Bar_ArgWithUntaggedNestedQueryParams_Result struct from its Thrift-level +// FromWire deserializes a Bar_ArgWithQueryParams_Result struct from its Thrift-level // representation. The Thrift-level representation may be obtained // from a ThriftRW protocol implementation. // -// An error is returned if we were unable to build a Bar_ArgWithUntaggedNestedQueryParams_Result struct +// An error is returned if we were unable to build a Bar_ArgWithQueryParams_Result struct // from the provided intermediate representation. // // x, err := binaryProtocol.Decode(reader, wire.TStruct) @@ -8299,12 +7777,12 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) ToWire() (wire.Value, erro // return nil, err // } // -// var v Bar_ArgWithUntaggedNestedQueryParams_Result +// var v Bar_ArgWithQueryParams_Result // if err := v.FromWire(x); err != nil { // return nil, err // } // return &v, nil -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) FromWire(w wire.Value) error { +func (v *Bar_ArgWithQueryParams_Result) FromWire(w wire.Value) error { var err error for _, field := range w.GetStruct().Fields { @@ -8325,15 +7803,15 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) FromWire(w wire.Value) err count++ } if count != 1 { - return fmt.Errorf("Bar_ArgWithUntaggedNestedQueryParams_Result should have exactly one field: got %v fields", count) + return fmt.Errorf("Bar_ArgWithQueryParams_Result should have exactly one field: got %v fields", count) } return nil } -// String returns a readable string representation of a Bar_ArgWithUntaggedNestedQueryParams_Result +// String returns a readable string representation of a Bar_ArgWithQueryParams_Result // struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) String() string { +func (v *Bar_ArgWithQueryParams_Result) String() string { if v == nil { return "" } @@ -8345,14 +7823,14 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) String() string { i++ } - return fmt.Sprintf("Bar_ArgWithUntaggedNestedQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) + return fmt.Sprintf("Bar_ArgWithQueryParams_Result{%v}", strings.Join(fields[:i], ", ")) } -// Equals returns true if all the fields of this Bar_ArgWithUntaggedNestedQueryParams_Result match the -// provided Bar_ArgWithUntaggedNestedQueryParams_Result. +// Equals returns true if all the fields of this Bar_ArgWithQueryParams_Result match the +// provided Bar_ArgWithQueryParams_Result. // // This function performs a deep comparison. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) Equals(rhs *Bar_ArgWithUntaggedNestedQueryParams_Result) bool { +func (v *Bar_ArgWithQueryParams_Result) Equals(rhs *Bar_ArgWithQueryParams_Result) bool { if v == nil { return rhs == nil } else if rhs == nil { @@ -8366,8 +7844,8 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) Equals(rhs *Bar_ArgWithUnt } // MarshalLogObject implements zapcore.ObjectMarshaler, enabling -// fast logging of Bar_ArgWithUntaggedNestedQueryParams_Result. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { +// fast logging of Bar_ArgWithQueryParams_Result. +func (v *Bar_ArgWithQueryParams_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) { if v == nil { return nil } @@ -8379,7 +7857,7 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalLogObject(enc zapco // GetSuccess returns the value of Success if it is set or its // zero value if it is unset. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) GetSuccess() (o *BarResponse) { +func (v *Bar_ArgWithQueryParams_Result) GetSuccess() (o *BarResponse) { if v != nil && v.Success != nil { return v.Success } @@ -8388,22 +7866,22 @@ func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) GetSuccess() (o *BarRespon } // IsSetSuccess returns true if Success is not nil. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) IsSetSuccess() bool { +func (v *Bar_ArgWithQueryParams_Result) IsSetSuccess() bool { return v != nil && v.Success != nil } // MethodName returns the name of the Thrift function as specified in // the IDL, for which this struct represent the result. // -// This will always be "argWithUntaggedNestedQueryParams" for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) MethodName() string { - return "argWithUntaggedNestedQueryParams" +// This will always be "argWithQueryParams" for this struct. +func (v *Bar_ArgWithQueryParams_Result) MethodName() string { + return "argWithQueryParams" } // EnvelopeType returns the kind of value inside this struct. // // This will always be Reply for this struct. -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) EnvelopeType() wire.EnvelopeType { +func (v *Bar_ArgWithQueryParams_Result) EnvelopeType() wire.EnvelopeType { return wire.Reply } diff --git a/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go b/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go index faca5ee61..ac2844a07 100644 --- a/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go +++ b/examples/example-gateway/build/gen-code/endpoints/bar/bar/bar_easyjson.go @@ -1,6 +1,6 @@ // Code generated by zanzibar // @generated -// Checksum : TX5y//rCD5kX8P3NgRGplQ== +// Checksum : 3/Fiw1ku1eV+qvOh6TLBEw== // Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package bar @@ -123,371 +123,7 @@ func (v *RequestWithDuplicateType) UnmarshalJSON(data []byte) error { func (v *RequestWithDuplicateType) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(in *jlexer.Lexer, out *QueryParamsUntaggedStruct) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - var NameSet bool - var CountSet bool - var FoosSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "name": - out.Name = string(in.String()) - NameSet = true - case "userUUID": - if in.IsNull() { - in.Skip() - out.UserUUID = nil - } else { - if out.UserUUID == nil { - out.UserUUID = new(string) - } - *out.UserUUID = string(in.String()) - } - case "count": - out.Count = int32(in.Int32()) - CountSet = true - case "optCount": - if in.IsNull() { - in.Skip() - out.OptCount = nil - } else { - if out.OptCount == nil { - out.OptCount = new(int32) - } - *out.OptCount = int32(in.Int32()) - } - case "foos": - if in.IsNull() { - in.Skip() - out.Foos = nil - } else { - in.Delim('[') - if out.Foos == nil { - if !in.IsDelim(']') { - out.Foos = make([]string, 0, 4) - } else { - out.Foos = []string{} - } - } else { - out.Foos = (out.Foos)[:0] - } - for !in.IsDelim(']') { - var v1 string - v1 = string(in.String()) - out.Foos = append(out.Foos, v1) - in.WantComma() - } - in.Delim(']') - } - FoosSet = true - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } - if !NameSet { - in.AddError(fmt.Errorf("key 'name' is required")) - } - if !CountSet { - in.AddError(fmt.Errorf("key 'count' is required")) - } - if !FoosSet { - in.AddError(fmt.Errorf("key 'foos' is required")) - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(out *jwriter.Writer, in QueryParamsUntaggedStruct) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"name\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Name)) - } - if in.UserUUID != nil { - const prefix string = ",\"userUUID\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(*in.UserUUID)) - } - { - const prefix string = ",\"count\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(in.Count)) - } - if in.OptCount != nil { - const prefix string = ",\"optCount\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(*in.OptCount)) - } - { - const prefix string = ",\"foos\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - if in.Foos == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { - out.RawString("null") - } else { - out.RawByte('[') - for v2, v3 := range in.Foos { - if v2 > 0 { - out.RawByte(',') - } - out.String(string(v3)) - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v QueryParamsUntaggedStruct) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v QueryParamsUntaggedStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *QueryParamsUntaggedStruct) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *QueryParamsUntaggedStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(in *jlexer.Lexer, out *QueryParamsUntaggedOptStruct) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - var NameSet bool - var CountSet bool - var FoosSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "name": - out.Name = string(in.String()) - NameSet = true - case "userUUID": - if in.IsNull() { - in.Skip() - out.UserUUID = nil - } else { - if out.UserUUID == nil { - out.UserUUID = new(string) - } - *out.UserUUID = string(in.String()) - } - case "count": - out.Count = int32(in.Int32()) - CountSet = true - case "optCount": - if in.IsNull() { - in.Skip() - out.OptCount = nil - } else { - if out.OptCount == nil { - out.OptCount = new(int32) - } - *out.OptCount = int32(in.Int32()) - } - case "foos": - if in.IsNull() { - in.Skip() - out.Foos = nil - } else { - in.Delim('[') - if out.Foos == nil { - if !in.IsDelim(']') { - out.Foos = make([]string, 0, 4) - } else { - out.Foos = []string{} - } - } else { - out.Foos = (out.Foos)[:0] - } - for !in.IsDelim(']') { - var v4 string - v4 = string(in.String()) - out.Foos = append(out.Foos, v4) - in.WantComma() - } - in.Delim(']') - } - FoosSet = true - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } - if !NameSet { - in.AddError(fmt.Errorf("key 'name' is required")) - } - if !CountSet { - in.AddError(fmt.Errorf("key 'count' is required")) - } - if !FoosSet { - in.AddError(fmt.Errorf("key 'foos' is required")) - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(out *jwriter.Writer, in QueryParamsUntaggedOptStruct) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"name\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Name)) - } - if in.UserUUID != nil { - const prefix string = ",\"userUUID\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(*in.UserUUID)) - } - { - const prefix string = ",\"count\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(in.Count)) - } - if in.OptCount != nil { - const prefix string = ",\"optCount\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(*in.OptCount)) - } - { - const prefix string = ",\"foos\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - if in.Foos == nil && (out.Flags&jwriter.NilSliceAsEmpty) == 0 { - out.RawString("null") - } else { - out.RawByte('[') - for v5, v6 := range in.Foos { - if v5 > 0 { - out.RawByte(',') - } - out.String(string(v6)) - } - out.RawByte(']') - } - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v QueryParamsUntaggedOptStruct) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v QueryParamsUntaggedOptStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *QueryParamsUntaggedOptStruct) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *QueryParamsUntaggedOptStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(in *jlexer.Lexer, out *QueryParamsStruct) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(in *jlexer.Lexer, out *QueryParamsStruct) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -557,9 +193,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Foo = (out.Foo)[:0] } for !in.IsDelim(']') { - var v7 string - v7 = string(in.String()) - out.Foo = append(out.Foo, v7) + var v1 string + v1 = string(in.String()) + out.Foo = append(out.Foo, v1) in.WantComma() } in.Delim(']') @@ -581,7 +217,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'foo' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(out *jwriter.Writer, in QueryParamsStruct) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(out *jwriter.Writer, in QueryParamsStruct) { out.RawByte('{') first := true _ = first @@ -637,11 +273,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v8, v9 := range in.Foo { - if v8 > 0 { + for v2, v3 := range in.Foo { + if v2 > 0 { out.RawByte(',') } - out.String(string(v9)) + out.String(string(v3)) } out.RawByte(']') } @@ -652,27 +288,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v QueryParamsStruct) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v QueryParamsStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *QueryParamsStruct) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *QueryParamsStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar1(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(in *jlexer.Lexer, out *QueryParamsOptsStruct) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(in *jlexer.Lexer, out *QueryParamsOptsStruct) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -738,7 +374,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'name' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(out *jwriter.Writer, in QueryParamsOptsStruct) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(out *jwriter.Writer, in QueryParamsOptsStruct) { out.RawByte('{') first := true _ = first @@ -788,27 +424,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v QueryParamsOptsStruct) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v QueryParamsOptsStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *QueryParamsOptsStruct) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *QueryParamsOptsStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar2(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(in *jlexer.Lexer, out *ParamsStruct) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(in *jlexer.Lexer, out *ParamsStruct) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -837,7 +473,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.Consumed() } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(out *jwriter.Writer, in ParamsStruct) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(out *jwriter.Writer, in ParamsStruct) { out.RawByte('{') first := true _ = first @@ -847,25 +483,25 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v ParamsStruct) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ParamsStruct) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ParamsStruct) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ParamsStruct) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar3(l, v) } func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarTooManyArgs(in *jlexer.Lexer, out *Bar_TooManyArgs_Result) { isTopLevel := in.IsStart() @@ -1222,9 +858,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v10 string - v10 = string(in.String()) - (out.FooMap)[key] = v10 + var v4 string + v4 = string(in.String()) + (out.FooMap)[key] = v4 in.WantComma() } in.Delim('}') @@ -1316,16 +952,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('{') - v11First := true - for v11Name, v11Value := range in.FooMap { - if v11First { - v11First = false + v5First := true + for v5Name, v5Value := range in.FooMap { + if v5First { + v5First = false } else { out.RawByte(',') } - out.String(string(v11Name)) + out.String(string(v5Name)) out.RawByte(':') - out.String(string(v11Value)) + out.String(string(v5Value)) } out.RawByte('}') } @@ -2032,9 +1668,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.DemoIds = (out.DemoIds)[:0] } for !in.IsDelim(']') { - var v12 string - v12 = string(in.String()) - out.DemoIds = append(out.DemoIds, v12) + var v6 string + v6 = string(in.String()) + out.DemoIds = append(out.DemoIds, v6) in.WantComma() } in.Delim(']') @@ -2081,11 +1717,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v13, v14 := range in.DemoIds { - if v13 > 0 { + for v7, v8 := range in.DemoIds { + if v7 > 0 { out.RawByte(',') } - out.String(string(v14)) + out.String(string(v8)) } out.RawByte(']') } @@ -2313,212 +1949,37 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.Consumed() } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(out *jwriter.Writer, in Bar_DeleteWithQueryParams_Result) { - out.RawByte('{') - first := true - _ = first - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Bar_DeleteWithQueryParams_Result) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_DeleteWithQueryParams_Result) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_DeleteWithQueryParams_Result) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_DeleteWithQueryParams_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(in *jlexer.Lexer, out *Bar_DeleteWithQueryParams_Args) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - var FilterSet bool - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "filter": - out.Filter = string(in.String()) - FilterSet = true - case "count": - if in.IsNull() { - in.Skip() - out.Count = nil - } else { - if out.Count == nil { - out.Count = new(int32) - } - *out.Count = int32(in.Int32()) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } - if !FilterSet { - in.AddError(fmt.Errorf("key 'filter' is required")) - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(out *jwriter.Writer, in Bar_DeleteWithQueryParams_Args) { - out.RawByte('{') - first := true - _ = first - { - const prefix string = ",\"filter\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Filter)) - } - if in.Count != nil { - const prefix string = ",\"count\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.Int32(int32(*in.Count)) - } - out.RawByte('}') -} - -// MarshalJSON supports json.Marshaler interface -func (v Bar_DeleteWithQueryParams_Args) MarshalJSON() ([]byte, error) { - w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(&w, v) - return w.Buffer.BuildBytes(), w.Error -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_DeleteWithQueryParams_Args) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(w, v) -} - -// UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_DeleteWithQueryParams_Args) UnmarshalJSON(data []byte) error { - r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(&r, v) - return r.Error() -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_DeleteWithQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(l, v) -} -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams(in *jlexer.Lexer, out *Bar_ArgWithUntaggedNestedQueryParams_Result) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeString() - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "success": - if in.IsNull() { - in.Skip() - out.Success = nil - } else { - if out.Success == nil { - out.Success = new(BarResponse) - } - (*out.Success).UnmarshalEasyJSON(in) - } - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams(out *jwriter.Writer, in Bar_ArgWithUntaggedNestedQueryParams_Result) { - out.RawByte('{') - first := true - _ = first - if in.Success != nil { - const prefix string = ",\"success\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - (*in.Success).MarshalEasyJSON(out) - } +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(out *jwriter.Writer, in Bar_DeleteWithQueryParams_Result) { + out.RawByte('{') + first := true + _ = first out.RawByte('}') } // MarshalJSON supports json.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalJSON() ([]byte, error) { +func (v Bar_DeleteWithQueryParams_Result) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Result) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams(w, v) +func (v Bar_DeleteWithQueryParams_Result) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(w, v) } // UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) UnmarshalJSON(data []byte) error { +func (v *Bar_DeleteWithQueryParams_Result) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams(l, v) +func (v *Bar_DeleteWithQueryParams_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams1(in *jlexer.Lexer, out *Bar_ArgWithUntaggedNestedQueryParams_Args) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(in *jlexer.Lexer, out *Bar_DeleteWithQueryParams_Args) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2527,7 +1988,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.Skip() return } - var RequestSet bool + var FilterSet bool in.Delim('{') for !in.IsDelim('}') { key := in.UnsafeString() @@ -2538,26 +1999,18 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo continue } switch key { - case "request": - if in.IsNull() { - in.Skip() - out.Request = nil - } else { - if out.Request == nil { - out.Request = new(QueryParamsUntaggedStruct) - } - (*out.Request).UnmarshalEasyJSON(in) - } - RequestSet = true - case "opt": + case "filter": + out.Filter = string(in.String()) + FilterSet = true + case "count": if in.IsNull() { in.Skip() - out.Opt = nil + out.Count = nil } else { - if out.Opt == nil { - out.Opt = new(QueryParamsUntaggedOptStruct) + if out.Count == nil { + out.Count = new(int32) } - (*out.Opt).UnmarshalEasyJSON(in) + *out.Count = int32(in.Int32()) } default: in.SkipRecursive() @@ -2568,63 +2021,59 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo if isTopLevel { in.Consumed() } - if !RequestSet { - in.AddError(fmt.Errorf("key 'request' is required")) + if !FilterSet { + in.AddError(fmt.Errorf("key 'filter' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams1(out *jwriter.Writer, in Bar_ArgWithUntaggedNestedQueryParams_Args) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(out *jwriter.Writer, in Bar_DeleteWithQueryParams_Args) { out.RawByte('{') first := true _ = first { - const prefix string = ",\"request\":" + const prefix string = ",\"filter\":" if first { first = false out.RawString(prefix[1:]) } else { out.RawString(prefix) } - if in.Request == nil { - out.RawString("null") - } else { - (*in.Request).MarshalEasyJSON(out) - } + out.String(string(in.Filter)) } - if in.Opt != nil { - const prefix string = ",\"opt\":" + if in.Count != nil { + const prefix string = ",\"count\":" if first { first = false out.RawString(prefix[1:]) } else { out.RawString(prefix) } - (*in.Opt).MarshalEasyJSON(out) + out.Int32(int32(*in.Count)) } out.RawByte('}') } // MarshalJSON supports json.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Args) MarshalJSON() ([]byte, error) { +func (v Bar_DeleteWithQueryParams_Args) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams1(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface -func (v Bar_ArgWithUntaggedNestedQueryParams_Args) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams1(w, v) +func (v Bar_DeleteWithQueryParams_Args) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(w, v) } // UnmarshalJSON supports json.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) UnmarshalJSON(data []byte) error { +func (v *Bar_DeleteWithQueryParams_Args) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams1(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *Bar_ArgWithUntaggedNestedQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithUntaggedNestedQueryParams1(l, v) +func (v *Bar_DeleteWithQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarDeleteWithQueryParams1(l, v) } func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithQueryParams(in *jlexer.Lexer, out *Bar_ArgWithQueryParams_Result) { isTopLevel := in.IsStart() @@ -2755,9 +2204,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Foo = (out.Foo)[:0] } for !in.IsDelim(']') { - var v15 string - v15 = string(in.String()) - out.Foo = append(out.Foo, v15) + var v9 string + v9 = string(in.String()) + out.Foo = append(out.Foo, v9) in.WantComma() } in.Delim(']') @@ -2778,9 +2227,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.Bar = (out.Bar)[:0] } for !in.IsDelim(']') { - var v16 int8 - v16 = int8(in.Int8()) - out.Bar = append(out.Bar, v16) + var v10 int8 + v10 = int8(in.Int8()) + out.Bar = append(out.Bar, v10) in.WantComma() } in.Delim(']') @@ -2836,11 +2285,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v17, v18 := range in.Foo { - if v17 > 0 { + for v11, v12 := range in.Foo { + if v11 > 0 { out.RawByte(',') } - out.String(string(v18)) + out.String(string(v12)) } out.RawByte(']') } @@ -2857,11 +2306,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v19, v20 := range in.Bar { - if v19 > 0 { + for v13, v14 := range in.Bar { + if v13 > 0 { out.RawByte(',') } - out.Int8(int8(v20)) + out.Int8(int8(v14)) } out.RawByte(']') } @@ -3579,6 +3028,221 @@ func (v *Bar_ArgWithNestedQueryParams_Args) UnmarshalJSON(data []byte) error { func (v *Bar_ArgWithNestedQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNestedQueryParams1(l, v) } +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams(in *jlexer.Lexer, out *Bar_ArgWithNearDupQueryParams_Result) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "success": + if in.IsNull() { + in.Skip() + out.Success = nil + } else { + if out.Success == nil { + out.Success = new(BarResponse) + } + (*out.Success).UnmarshalEasyJSON(in) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams(out *jwriter.Writer, in Bar_ArgWithNearDupQueryParams_Result) { + out.RawByte('{') + first := true + _ = first + if in.Success != nil { + const prefix string = ",\"success\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.Success).MarshalEasyJSON(out) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Result) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Result) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Result) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Result) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams(l, v) +} +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams1(in *jlexer.Lexer, out *Bar_ArgWithNearDupQueryParams_Args) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + var OneSet bool + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "one": + out.One = string(in.String()) + OneSet = true + case "two": + if in.IsNull() { + in.Skip() + out.Two = nil + } else { + if out.Two == nil { + out.Two = new(int32) + } + *out.Two = int32(in.Int32()) + } + case "three": + if in.IsNull() { + in.Skip() + out.Three = nil + } else { + if out.Three == nil { + out.Three = new(string) + } + *out.Three = string(in.String()) + } + case "four": + if in.IsNull() { + in.Skip() + out.Four = nil + } else { + if out.Four == nil { + out.Four = new(string) + } + *out.Four = string(in.String()) + } + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } + if !OneSet { + in.AddError(fmt.Errorf("key 'one' is required")) + } +} +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams1(out *jwriter.Writer, in Bar_ArgWithNearDupQueryParams_Args) { + out.RawByte('{') + first := true + _ = first + { + const prefix string = ",\"one\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.One)) + } + if in.Two != nil { + const prefix string = ",\"two\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.Int32(int32(*in.Two)) + } + if in.Three != nil { + const prefix string = ",\"three\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(*in.Three)) + } + if in.Four != nil { + const prefix string = ",\"four\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(*in.Four)) + } + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Args) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams1(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v Bar_ArgWithNearDupQueryParams_Args) MarshalEasyJSON(w *jwriter.Writer) { + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams1(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Args) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams1(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *Bar_ArgWithNearDupQueryParams_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithNearDupQueryParams1(l, v) +} func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgWithManyQueryParams(in *jlexer.Lexer, out *Bar_ArgWithManyQueryParams_Result) { isTopLevel := in.IsStart() if in.IsNull() { @@ -3809,9 +3473,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AListUUID = (out.AListUUID)[:0] } for !in.IsDelim(']') { - var v21 UUID - v21 = UUID(in.String()) - out.AListUUID = append(out.AListUUID, v21) + var v15 UUID + v15 = UUID(in.String()) + out.AListUUID = append(out.AListUUID, v15) in.WantComma() } in.Delim(']') @@ -3833,9 +3497,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptListUUID = (out.AnOptListUUID)[:0] } for !in.IsDelim(']') { - var v22 UUID - v22 = UUID(in.String()) - out.AnOptListUUID = append(out.AnOptListUUID, v22) + var v16 UUID + v16 = UUID(in.String()) + out.AnOptListUUID = append(out.AnOptListUUID, v16) in.WantComma() } in.Delim(']') @@ -3856,9 +3520,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AStringList = (out.AStringList)[:0] } for !in.IsDelim(']') { - var v23 string - v23 = string(in.String()) - out.AStringList = append(out.AStringList, v23) + var v17 string + v17 = string(in.String()) + out.AStringList = append(out.AStringList, v17) in.WantComma() } in.Delim(']') @@ -3880,9 +3544,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptStringList = (out.AnOptStringList)[:0] } for !in.IsDelim(']') { - var v24 string - v24 = string(in.String()) - out.AnOptStringList = append(out.AnOptStringList, v24) + var v18 string + v18 = string(in.String()) + out.AnOptStringList = append(out.AnOptStringList, v18) in.WantComma() } in.Delim(']') @@ -3903,9 +3567,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AUUIDList = (out.AUUIDList)[:0] } for !in.IsDelim(']') { - var v25 UUID - v25 = UUID(in.String()) - out.AUUIDList = append(out.AUUIDList, v25) + var v19 UUID + v19 = UUID(in.String()) + out.AUUIDList = append(out.AUUIDList, v19) in.WantComma() } in.Delim(']') @@ -3927,9 +3591,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.AnOptUUIDList = (out.AnOptUUIDList)[:0] } for !in.IsDelim(']') { - var v26 UUID - v26 = UUID(in.String()) - out.AnOptUUIDList = append(out.AnOptUUIDList, v26) + var v20 UUID + v20 = UUID(in.String()) + out.AnOptUUIDList = append(out.AnOptUUIDList, v20) in.WantComma() } in.Delim(']') @@ -4173,11 +3837,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v27, v28 := range in.AListUUID { - if v27 > 0 { + for v21, v22 := range in.AListUUID { + if v21 > 0 { out.RawByte(',') } - out.String(string(v28)) + out.String(string(v22)) } out.RawByte(']') } @@ -4192,11 +3856,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v29, v30 := range in.AnOptListUUID { - if v29 > 0 { + for v23, v24 := range in.AnOptListUUID { + if v23 > 0 { out.RawByte(',') } - out.String(string(v30)) + out.String(string(v24)) } out.RawByte(']') } @@ -4213,11 +3877,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v31, v32 := range in.AStringList { - if v31 > 0 { + for v25, v26 := range in.AStringList { + if v25 > 0 { out.RawByte(',') } - out.String(string(v32)) + out.String(string(v26)) } out.RawByte(']') } @@ -4232,11 +3896,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v33, v34 := range in.AnOptStringList { - if v33 > 0 { + for v27, v28 := range in.AnOptStringList { + if v27 > 0 { out.RawByte(',') } - out.String(string(v34)) + out.String(string(v28)) } out.RawByte(']') } @@ -4253,11 +3917,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString("null") } else { out.RawByte('[') - for v35, v36 := range in.AUUIDList { - if v35 > 0 { + for v29, v30 := range in.AUUIDList { + if v29 > 0 { out.RawByte(',') } - out.String(string(v36)) + out.String(string(v30)) } out.RawByte(']') } @@ -4272,11 +3936,11 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo } { out.RawByte('[') - for v37, v38 := range in.AnOptUUIDList { - if v37 > 0 { + for v31, v32 := range in.AnOptUUIDList { + if v31 > 0 { out.RawByte(',') } - out.String(string(v38)) + out.String(string(v32)) } out.RawByte(']') } @@ -4637,7 +4301,7 @@ func (v *Bar_ArgNotStruct_Args) UnmarshalJSON(data []byte) error { func (v *Bar_ArgNotStruct_Args) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBarBarArgNotStruct1(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(in *jlexer.Lexer, out *BarResponse) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(in *jlexer.Lexer, out *BarResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4684,9 +4348,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := UUID(in.String()) in.WantColon() - var v39 int32 - v39 = int32(in.Int32()) - (out.MapIntWithRange)[key] = v39 + var v33 int32 + v33 = int32(in.Int32()) + (out.MapIntWithRange)[key] = v33 in.WantComma() } in.Delim('}') @@ -4705,9 +4369,9 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo for !in.IsDelim('}') { key := string(in.String()) in.WantColon() - var v40 int32 - v40 = int32(in.Int32()) - (out.MapIntWithoutRange)[key] = v40 + var v34 int32 + v34 = int32(in.Int32()) + (out.MapIntWithoutRange)[key] = v34 in.WantComma() } in.Delim('}') @@ -4759,7 +4423,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'binaryField' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(out *jwriter.Writer, in BarResponse) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(out *jwriter.Writer, in BarResponse) { out.RawByte('{') first := true _ = first @@ -4805,16 +4469,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v42First := true - for v42Name, v42Value := range in.MapIntWithRange { - if v42First { - v42First = false + v36First := true + for v36Name, v36Value := range in.MapIntWithRange { + if v36First { + v36First = false } else { out.RawByte(',') } - out.String(string(v42Name)) + out.String(string(v36Name)) out.RawByte(':') - out.Int32(int32(v42Value)) + out.Int32(int32(v36Value)) } out.RawByte('}') } @@ -4831,16 +4495,16 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo out.RawString(`null`) } else { out.RawByte('{') - v43First := true - for v43Name, v43Value := range in.MapIntWithoutRange { - if v43First { - v43First = false + v37First := true + for v37Name, v37Value := range in.MapIntWithoutRange { + if v37First { + v37First = false } else { out.RawByte(',') } - out.String(string(v43Name)) + out.String(string(v37Name)) out.RawByte(':') - out.Int32(int32(v43Value)) + out.Int32(int32(v37Value)) } out.RawByte('}') } @@ -4871,27 +4535,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar4(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar7(in *jlexer.Lexer, out *BarRequest) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(in *jlexer.Lexer, out *BarRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4973,7 +4637,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'longField' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar7(out *jwriter.Writer, in BarRequest) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(out *jwriter.Writer, in BarRequest) { out.RawByte('{') first := true _ = first @@ -5043,27 +4707,27 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar7(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar7(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar7(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar7(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar5(l, v) } -func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar8(in *jlexer.Lexer, out *BarException) { +func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(in *jlexer.Lexer, out *BarException) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5099,7 +4763,7 @@ func easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo in.AddError(fmt.Errorf("key 'stringField' is required")) } } -func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar8(out *jwriter.Writer, in BarException) { +func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(out *jwriter.Writer, in BarException) { out.RawByte('{') first := true _ = first @@ -5119,23 +4783,23 @@ func easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCo // MarshalJSON supports json.Marshaler interface func (v BarException) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar8(&w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BarException) MarshalEasyJSON(w *jwriter.Writer) { - easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar8(w, v) + easyjson4347b5c1EncodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *BarException) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar8(&r, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BarException) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar8(l, v) + easyjson4347b5c1DecodeGithubComUberZanzibarExamplesExampleGatewayBuildGenCodeEndpointsBarBar6(l, v) } diff --git a/examples/example-gateway/clients/bar/client-config.json b/examples/example-gateway/clients/bar/client-config.json index fd4bd5fe2..ad9b8723c 100644 --- a/examples/example-gateway/clients/bar/client-config.json +++ b/examples/example-gateway/clients/bar/client-config.json @@ -14,7 +14,7 @@ "ArgWithHeaders": "Bar::argWithHeaders", "ArgWithQueryParams": "Bar::argWithQueryParams", "ArgWithNestedQueryParams": "Bar::argWithNestedQueryParams", - "ArgWithUntaggedNestedQueryParams": "Bar::argWithUntaggedNestedQueryParams", + "ArgWithNearDupQueryParams": "Bar::argWithNearDupQueryParams", "ArgWithQueryHeader": "Bar::argWithQueryHeader", "ArgWithManyQueryParams": "Bar::argWithManyQueryParams", "ArgWithParams": "Bar::argWithParams", diff --git a/examples/example-gateway/endpoints/bar/arg_with_untagged_nested_query_params.yaml b/examples/example-gateway/endpoints/bar/arg_with_near_dup_query_params.yaml similarity index 59% rename from examples/example-gateway/endpoints/bar/arg_with_untagged_nested_query_params.yaml rename to examples/example-gateway/endpoints/bar/arg_with_near_dup_query_params.yaml index 58cd5fc0d..d393ec55a 100644 --- a/examples/example-gateway/endpoints/bar/arg_with_untagged_nested_query_params.yaml +++ b/examples/example-gateway/endpoints/bar/arg_with_near_dup_query_params.yaml @@ -1,13 +1,13 @@ clientId: bar -clientMethod: ArgWithUntaggedNestedQueryParams +clientMethod: ArgWithNearDupQueryParams endpointId: bar endpointType: http -handleId: argWithUntaggedNestedQueryParams +handleId: argWithNearDupQueryParams middlewares: [] reqHeaderMap: {} resHeaderMap: {} testFixtures: {} thriftFile: endpoints/bar/bar.thrift thriftFileSha: '{{placeholder}}' -thriftMethodName: Bar::argWithUntaggedNestedQueryParams +thriftMethodName: Bar::argWithNearDupQueryParams workflowType: httpClient diff --git a/examples/example-gateway/endpoints/bar/endpoint-config.yaml b/examples/example-gateway/endpoints/bar/endpoint-config.yaml index 559601dce..a6d25d86d 100644 --- a/examples/example-gateway/endpoints/bar/endpoint-config.yaml +++ b/examples/example-gateway/endpoints/bar/endpoint-config.yaml @@ -4,7 +4,7 @@ config: - arg_with_headers.yaml - arg_with_query_params.yaml - arg_with_nested_query_params.yaml - - arg_with_untagged_nested_query_params.yaml + - arg_with_near_dup_query_params.yaml - arg_with_query_header.yaml - arg_with_params.yaml - arg_with_many_query_params.yaml diff --git a/examples/example-gateway/idl/clients/bar/bar.thrift b/examples/example-gateway/idl/clients/bar/bar.thrift index 56cfb65ed..7d8afc2b8 100644 --- a/examples/example-gateway/idl/clients/bar/bar.thrift +++ b/examples/example-gateway/idl/clients/bar/bar.thrift @@ -68,22 +68,6 @@ struct QueryParamsOptsStruct { 4: optional string authUUID2 } -struct QueryParamsUntaggedStruct { - 1: required string name - 2: optional string userUUID - 3: required i32 count - 4: optional i32 optCount - 5: required list foos -} - -struct QueryParamsUntaggedOptStruct { - 1: required string name - 2: optional string userUUID - 3: required i32 count - 4: optional i32 optCount - 5: required list foos -} - struct ParamsStruct { 1: required string userUUID (zanzibar.http.ref = "params.user-uuid") } @@ -214,15 +198,6 @@ service Bar { zanzibar.http.status = "200" ) - BarResponse argWithUntaggedNestedQueryParams( - 1: required QueryParamsUntaggedStruct request (zanzibar.http.ref = "query.request") - 2: optional QueryParamsUntaggedOptStruct opt (zanzibar.http.ref = "query.opt") - ) ( - zanzibar.http.method = "GET" - zanzibar.http.path = "/bar/argWithUntaggedNestedQueryParams" - zanzibar.http.status = "200" - ) - // TODO: support headers annotation BarResponse argWithQueryHeader( 1: optional string userUUID @@ -244,9 +219,7 @@ service Bar { BarResponse argWithManyQueryParams( 1: required string aStr (zanzibar.http.ref = "query.aStr") 2: optional string anOptStr (zanzibar.http.ref = "query.anOptStr") - 3: required bool aBool ( - zanzibar.http.ref = "query.aBoolean" - ) + 3: required bool aBool (zanzibar.http.ref = "query.aBoolean") 4: optional bool anOptBool (zanzibar.http.ref = "query.anOptBool") 5: required i8 aInt8 (zanzibar.http.ref = "query.aInt8") 6: optional i8 anOptInt8 (zanzibar.http.ref = "query.anOptInt8") @@ -283,6 +256,17 @@ service Bar { zanzibar.http.status = "200" ) + BarResponse argWithNearDupQueryParams( + 1: required string one + 2: optional i32 two + 3: string three (zanzibar.http.ref = "query.One_NamE") + 4: optional string four (zanzibar.http.ref = "query.one-Name") + ) ( + zanzibar.http.method = "GET" + zanzibar.http.path = "/bar/clientArgWithNearDupQueryParams" + zanzibar.http.status = "200" + ) + void deleteFoo( 1: required string userUUID (zanzibar.http.ref = "headers.x-uuid") ) ( diff --git a/examples/example-gateway/idl/endpoints/bar/bar.thrift b/examples/example-gateway/idl/endpoints/bar/bar.thrift index 2fa0f867b..f22c93848 100644 --- a/examples/example-gateway/idl/endpoints/bar/bar.thrift +++ b/examples/example-gateway/idl/endpoints/bar/bar.thrift @@ -58,22 +58,6 @@ struct QueryParamsOptsStruct { 4: optional string authUUID2 } -struct QueryParamsUntaggedStruct { - 1: required string name - 2: optional string userUUID - 3: required i32 count - 4: optional i32 optCount - 5: required list foos -} - -struct QueryParamsUntaggedOptStruct { - 1: required string name - 2: optional string userUUID - 3: required i32 count - 4: optional i32 optCount - 5: required list foos -} - struct ParamsStruct { 1: required string userUUID ( zanzibar.http.ref = "params.user-uuid" @@ -195,15 +179,6 @@ service Bar { zanzibar.http.status = "200" ) - BarResponse argWithUntaggedNestedQueryParams( - 1: required QueryParamsUntaggedStruct request (zanzibar.http.ref = "query.request") - 2: optional QueryParamsUntaggedOptStruct opt (zanzibar.http.ref = "query.opt") - ) ( - zanzibar.http.method = "GET" - zanzibar.http.path = "/bar/argWithUntaggedNestedQueryParams" - zanzibar.http.status = "200" - ) - BarResponse argWithQueryHeader( 1: optional string userUUID ( zanzibar.http.ref = "headers.x-uuid" @@ -266,6 +241,17 @@ service Bar { zanzibar.http.status = "200" ) + BarResponse argWithNearDupQueryParams( + 1: required string one (zanzibar.http.ref = "query.oneName") + 2: optional i32 two (zanzibar.http.ref = "query.one_name") + 3: string three (zanzibar.http.ref = "query.One_NamE") + 4: optional string four (zanzibar.http.ref = "query.one-Name") + ) ( + zanzibar.http.method = "GET" + zanzibar.http.path = "/bar/argWithNearDupQueryParams" + zanzibar.http.status = "200" + ) + void deleteWithQueryParams( 2: required string filter (zanzibar.http.ref = "query.filter") 3: optional i32 count (zanzibar.http.ref = "query.count") diff --git a/test/endpoints/bar/bar_arg_with_query_params_test.go b/test/endpoints/bar/bar_arg_with_query_params_test.go index 14af159d6..b6ccb4c15 100644 --- a/test/endpoints/bar/bar_arg_with_query_params_test.go +++ b/test/endpoints/bar/bar_arg_with_query_params_test.go @@ -959,7 +959,7 @@ func TestBarWithNestedQueryParamsWithoutHeaders(t *testing.T) { assert.Equal(t, string(respBytes), compactStr(barResponseBytes)) } -func TestBarWithUntaggedNestedQueryParams(t *testing.T) { +func TestBarWithNearDupQueryParams(t *testing.T) { var counter int = 0 gateway, err := testGateway.CreateGateway(t, nil, &testGateway.Options{ @@ -973,11 +973,10 @@ func TestBarWithUntaggedNestedQueryParams(t *testing.T) { defer gateway.Close() gateway.HTTPBackends()["bar"].HandleFunc( - "GET", "/bar/argWithUntaggedNestedQueryParams", + "GET", "/bar/clientArgWithNearDupQueryParams", func(w http.ResponseWriter, r *http.Request) { assert.Equal(t, - "opt.count=33&opt.foos=coffee&opt.name=b-name&opt.optCount=99&"+ - "request.count=3&request.foos=hi&request.foos=world&request.name=a-name&request.optCount=4&request.userUUID=a-uuid", + "One_NamE=three&one=one&one-Name=four&two=22", r.URL.RawQuery, ) @@ -991,13 +990,10 @@ func TestBarWithUntaggedNestedQueryParams(t *testing.T) { res, err := gateway.MakeRequest( "GET", - "/bar/argWithUntaggedNestedQueryParams?"+ - "request.name=a-name&request.userUUID=a-uuid&request.count=3&request.optCount=4&request.foos=hi&request.foos=world&"+ - "opt.name=b-name&opt.count=33&opt.optCount=99&opt.foos=coffee", - map[string]string{ - "x-uuid": "auth-uuid", - "x-uuid2": "auth-uuid2", - }, nil, + "/bar/argWithNearDupQueryParams?"+ + "oneName=one&one_name=22&One_NamE=three&one-Name=four", + map[string]string{}, + nil, ) if !assert.NoError(t, err, "got http error") { return