// @generated by Thrift for [[[ program path ]]] // This file is probably not the place you want to edit! package module // [[[ program thrift source path ]]] import ( "context" "fmt" "strings" "sync" thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift" metadata "github.com/facebook/fbthrift/thrift/lib/thrift/metadata" ) // (needed to ensure safety because of naive import list construction) var _ = context.Background var _ = fmt.Printf var _ = strings.Split var _ = sync.Mutex{} var _ = thrift.ZERO var _ = metadata.GoUnusedProtection__ type NestedContainers interface { MapList(ctx context.Context, foo map[int32][]int32) (error) MapSet(ctx context.Context, foo map[int32][]int32) (error) ListMap(ctx context.Context, foo []map[int32]int32) (error) ListSet(ctx context.Context, foo [][]int32) (error) Turtles(ctx context.Context, foo [][]map[int32]map[int32][]int32) (error) } type NestedContainersChannelClientInterface interface { thrift.ClientInterface NestedContainers } type NestedContainersClientInterface interface { thrift.ClientInterface MapList(foo map[int32][]int32) (error) MapSet(foo map[int32][]int32) (error) ListMap(foo []map[int32]int32) (error) ListSet(foo [][]int32) (error) Turtles(foo [][]map[int32]map[int32][]int32) (error) } type NestedContainersContextClientInterface interface { NestedContainersClientInterface MapListContext(ctx context.Context, foo map[int32][]int32) (error) MapSetContext(ctx context.Context, foo map[int32][]int32) (error) ListMapContext(ctx context.Context, foo []map[int32]int32) (error) ListSetContext(ctx context.Context, foo [][]int32) (error) TurtlesContext(ctx context.Context, foo [][]map[int32]map[int32][]int32) (error) } type NestedContainersChannelClient struct { ch thrift.RequestChannel } // Compile time interface enforcer var _ NestedContainersChannelClientInterface = &NestedContainersChannelClient{} func NewNestedContainersChannelClient(channel thrift.RequestChannel) *NestedContainersChannelClient { return &NestedContainersChannelClient{ ch: channel, } } func (c *NestedContainersChannelClient) Close() error { return c.ch.Close() } type NestedContainersClient struct { chClient *NestedContainersChannelClient Mu sync.Mutex } // Compile time interface enforcer var _ NestedContainersClientInterface = &NestedContainersClient{} var _ NestedContainersContextClientInterface = &NestedContainersClient{} func NewNestedContainersClient(prot thrift.Protocol) *NestedContainersClient { return &NestedContainersClient{ chClient: NewNestedContainersChannelClient( thrift.NewSerialChannel(prot), ), } } func (c *NestedContainersClient) Close() error { return c.chClient.Close() } func (c *NestedContainersChannelClient) MapList(ctx context.Context, foo map[int32][]int32) (error) { in := &reqNestedContainersMapList{ Foo: foo, } out := newRespNestedContainersMapList() err := c.ch.Call(ctx, "mapList", in, out) if err != nil { return err } return nil } func (c *NestedContainersClient) MapList(foo map[int32][]int32) (error) { return c.chClient.MapList(context.Background(), foo) } func (c *NestedContainersClient) MapListContext(ctx context.Context, foo map[int32][]int32) (error) { return c.chClient.MapList(ctx, foo) } func (c *NestedContainersChannelClient) MapSet(ctx context.Context, foo map[int32][]int32) (error) { in := &reqNestedContainersMapSet{ Foo: foo, } out := newRespNestedContainersMapSet() err := c.ch.Call(ctx, "mapSet", in, out) if err != nil { return err } return nil } func (c *NestedContainersClient) MapSet(foo map[int32][]int32) (error) { return c.chClient.MapSet(context.Background(), foo) } func (c *NestedContainersClient) MapSetContext(ctx context.Context, foo map[int32][]int32) (error) { return c.chClient.MapSet(ctx, foo) } func (c *NestedContainersChannelClient) ListMap(ctx context.Context, foo []map[int32]int32) (error) { in := &reqNestedContainersListMap{ Foo: foo, } out := newRespNestedContainersListMap() err := c.ch.Call(ctx, "listMap", in, out) if err != nil { return err } return nil } func (c *NestedContainersClient) ListMap(foo []map[int32]int32) (error) { return c.chClient.ListMap(context.Background(), foo) } func (c *NestedContainersClient) ListMapContext(ctx context.Context, foo []map[int32]int32) (error) { return c.chClient.ListMap(ctx, foo) } func (c *NestedContainersChannelClient) ListSet(ctx context.Context, foo [][]int32) (error) { in := &reqNestedContainersListSet{ Foo: foo, } out := newRespNestedContainersListSet() err := c.ch.Call(ctx, "listSet", in, out) if err != nil { return err } return nil } func (c *NestedContainersClient) ListSet(foo [][]int32) (error) { return c.chClient.ListSet(context.Background(), foo) } func (c *NestedContainersClient) ListSetContext(ctx context.Context, foo [][]int32) (error) { return c.chClient.ListSet(ctx, foo) } func (c *NestedContainersChannelClient) Turtles(ctx context.Context, foo [][]map[int32]map[int32][]int32) (error) { in := &reqNestedContainersTurtles{ Foo: foo, } out := newRespNestedContainersTurtles() err := c.ch.Call(ctx, "turtles", in, out) if err != nil { return err } return nil } func (c *NestedContainersClient) Turtles(foo [][]map[int32]map[int32][]int32) (error) { return c.chClient.Turtles(context.Background(), foo) } func (c *NestedContainersClient) TurtlesContext(ctx context.Context, foo [][]map[int32]map[int32][]int32) (error) { return c.chClient.Turtles(ctx, foo) } type reqNestedContainersMapList struct { Foo map[int32][]int32 `thrift:"foo,1" json:"foo" db:"foo"` } // Compile time interface enforcer var _ thrift.Struct = &reqNestedContainersMapList{} // Deprecated: NestedContainersMapListArgsDeprecated is deprecated, since it is supposed to be internal. type NestedContainersMapListArgsDeprecated = reqNestedContainersMapList func newReqNestedContainersMapList() *reqNestedContainersMapList { return (&reqNestedContainersMapList{}). SetFooNonCompat(make(map[int32][]int32)) } func (x *reqNestedContainersMapList) GetFooNonCompat() map[int32][]int32 { return x.Foo } func (x *reqNestedContainersMapList) GetFoo() map[int32][]int32 { if !x.IsSetFoo() { return make(map[int32][]int32) } return x.Foo } func (x *reqNestedContainersMapList) SetFooNonCompat(value map[int32][]int32) *reqNestedContainersMapList { x.Foo = value return x } func (x *reqNestedContainersMapList) SetFoo(value map[int32][]int32) *reqNestedContainersMapList { x.Foo = value return x } func (x *reqNestedContainersMapList) IsSetFoo() bool { return x != nil && x.Foo != nil } func (x *reqNestedContainersMapList) writeField1(p thrift.Format) error { // Foo if err := p.WriteFieldBegin("foo", thrift.MAP, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetFooNonCompat() if err := p.WriteMapBegin(thrift.I32, thrift.LIST, len(item)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range item { { item := k if err := p.WriteI32(item); err != nil { return err } } { item := v if err := p.WriteListBegin(thrift.I32, len(item)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range item { { item := v if err := p.WriteI32(item); err != nil { return err } } } if err := p.WriteListEnd(); err != nil { return thrift.PrependError("error writing list end: ", err) } } } if err := p.WriteMapEnd(); err != nil { return thrift.PrependError("error writing map end: ", err) } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqNestedContainersMapList) readField1(p thrift.Format) error { // Foo _ /* keyType */, _ /* valueType */, size, err := p.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } mapResult := make(map[int32][]int32, size) for i := 0; i < size; i++ { var key int32 { result, err := p.ReadI32() if err != nil { return err } key = result } var value []int32 { _ /* elemType */, size, err := p.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } listResult := make([]int32, 0, size) for i := 0; i < size; i++ { var elem int32 { result, err := p.ReadI32() if err != nil { return err } elem = result } listResult = append(listResult, elem) } if err := p.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } result := listResult value = result } mapResult[key] = value } if err := p.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } result := mapResult x.SetFooNonCompat(result) return nil } func (x *reqNestedContainersMapList) toString1() string { // Foo return fmt.Sprintf("%v", x.GetFooNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapList().Set().Set() type reqNestedContainersMapListBuilder struct { obj *reqNestedContainersMapList } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapList().Set().Set() func newReqNestedContainersMapListBuilder() *reqNestedContainersMapListBuilder { return &reqNestedContainersMapListBuilder{ obj: newReqNestedContainersMapList(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapList().Set().Set() func (x *reqNestedContainersMapListBuilder) Foo(value map[int32][]int32) *reqNestedContainersMapListBuilder { x.obj.Foo = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapList().Set().Set() func (x *reqNestedContainersMapListBuilder) Emit() *reqNestedContainersMapList { var objCopy reqNestedContainersMapList = *x.obj return &objCopy } func (x *reqNestedContainersMapList) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqNestedContainersMapList"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqNestedContainersMapList) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.MAP)): // foo if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqNestedContainersMapList) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqNestedContainersMapList({") sb.WriteString(fmt.Sprintf("Foo:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respNestedContainersMapList struct { } // Compile time interface enforcer var _ thrift.Struct = &respNestedContainersMapList{} var _ thrift.WritableResult = &respNestedContainersMapList{} // Deprecated: NestedContainersMapListResultDeprecated is deprecated, since it is supposed to be internal. type NestedContainersMapListResultDeprecated = respNestedContainersMapList func newRespNestedContainersMapList() *respNestedContainersMapList { return (&respNestedContainersMapList{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersMapList().Set().Set() type respNestedContainersMapListBuilder struct { obj *respNestedContainersMapList } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersMapList().Set().Set() func newRespNestedContainersMapListBuilder() *respNestedContainersMapListBuilder { return &respNestedContainersMapListBuilder{ obj: newRespNestedContainersMapList(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersMapList().Set().Set() func (x *respNestedContainersMapListBuilder) Emit() *respNestedContainersMapList { var objCopy respNestedContainersMapList = *x.obj return &objCopy } func (x *respNestedContainersMapList) Exception() thrift.WritableException { return nil } func (x *respNestedContainersMapList) Write(p thrift.Format) error { if err := p.WriteStructBegin("respNestedContainersMapList"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respNestedContainersMapList) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respNestedContainersMapList) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respNestedContainersMapList({") sb.WriteString("})") return sb.String() } type reqNestedContainersMapSet struct { Foo map[int32][]int32 `thrift:"foo,1" json:"foo" db:"foo"` } // Compile time interface enforcer var _ thrift.Struct = &reqNestedContainersMapSet{} // Deprecated: NestedContainersMapSetArgsDeprecated is deprecated, since it is supposed to be internal. type NestedContainersMapSetArgsDeprecated = reqNestedContainersMapSet func newReqNestedContainersMapSet() *reqNestedContainersMapSet { return (&reqNestedContainersMapSet{}). SetFooNonCompat(make(map[int32][]int32)) } func (x *reqNestedContainersMapSet) GetFooNonCompat() map[int32][]int32 { return x.Foo } func (x *reqNestedContainersMapSet) GetFoo() map[int32][]int32 { if !x.IsSetFoo() { return make(map[int32][]int32) } return x.Foo } func (x *reqNestedContainersMapSet) SetFooNonCompat(value map[int32][]int32) *reqNestedContainersMapSet { x.Foo = value return x } func (x *reqNestedContainersMapSet) SetFoo(value map[int32][]int32) *reqNestedContainersMapSet { x.Foo = value return x } func (x *reqNestedContainersMapSet) IsSetFoo() bool { return x != nil && x.Foo != nil } func (x *reqNestedContainersMapSet) writeField1(p thrift.Format) error { // Foo if err := p.WriteFieldBegin("foo", thrift.MAP, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetFooNonCompat() if err := p.WriteMapBegin(thrift.I32, thrift.SET, len(item)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range item { { item := k if err := p.WriteI32(item); err != nil { return err } } { item := v if err := p.WriteSetBegin(thrift.I32, len(item)); err != nil { return thrift.PrependError("error writing set begin: ", err) } for _, v := range item { { item := v if err := p.WriteI32(item); err != nil { return err } } } if err := p.WriteSetEnd(); err != nil { return thrift.PrependError("error writing set end: ", err) } } } if err := p.WriteMapEnd(); err != nil { return thrift.PrependError("error writing map end: ", err) } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqNestedContainersMapSet) readField1(p thrift.Format) error { // Foo _ /* keyType */, _ /* valueType */, size, err := p.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } mapResult := make(map[int32][]int32, size) for i := 0; i < size; i++ { var key int32 { result, err := p.ReadI32() if err != nil { return err } key = result } var value []int32 { _ /* elemType */, size, err := p.ReadSetBegin() if err != nil { return thrift.PrependError("error reading set begin: ", err) } setResult := make([]int32, 0, size) for i := 0; i < size; i++ { var elem int32 { result, err := p.ReadI32() if err != nil { return err } elem = result } setResult = append(setResult, elem) } if err := p.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) } result := setResult value = result } mapResult[key] = value } if err := p.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } result := mapResult x.SetFooNonCompat(result) return nil } func (x *reqNestedContainersMapSet) toString1() string { // Foo return fmt.Sprintf("%v", x.GetFooNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapSet().Set().Set() type reqNestedContainersMapSetBuilder struct { obj *reqNestedContainersMapSet } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapSet().Set().Set() func newReqNestedContainersMapSetBuilder() *reqNestedContainersMapSetBuilder { return &reqNestedContainersMapSetBuilder{ obj: newReqNestedContainersMapSet(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapSet().Set().Set() func (x *reqNestedContainersMapSetBuilder) Foo(value map[int32][]int32) *reqNestedContainersMapSetBuilder { x.obj.Foo = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersMapSet().Set().Set() func (x *reqNestedContainersMapSetBuilder) Emit() *reqNestedContainersMapSet { var objCopy reqNestedContainersMapSet = *x.obj return &objCopy } func (x *reqNestedContainersMapSet) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqNestedContainersMapSet"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqNestedContainersMapSet) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.MAP)): // foo if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqNestedContainersMapSet) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqNestedContainersMapSet({") sb.WriteString(fmt.Sprintf("Foo:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respNestedContainersMapSet struct { } // Compile time interface enforcer var _ thrift.Struct = &respNestedContainersMapSet{} var _ thrift.WritableResult = &respNestedContainersMapSet{} // Deprecated: NestedContainersMapSetResultDeprecated is deprecated, since it is supposed to be internal. type NestedContainersMapSetResultDeprecated = respNestedContainersMapSet func newRespNestedContainersMapSet() *respNestedContainersMapSet { return (&respNestedContainersMapSet{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersMapSet().Set().Set() type respNestedContainersMapSetBuilder struct { obj *respNestedContainersMapSet } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersMapSet().Set().Set() func newRespNestedContainersMapSetBuilder() *respNestedContainersMapSetBuilder { return &respNestedContainersMapSetBuilder{ obj: newRespNestedContainersMapSet(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersMapSet().Set().Set() func (x *respNestedContainersMapSetBuilder) Emit() *respNestedContainersMapSet { var objCopy respNestedContainersMapSet = *x.obj return &objCopy } func (x *respNestedContainersMapSet) Exception() thrift.WritableException { return nil } func (x *respNestedContainersMapSet) Write(p thrift.Format) error { if err := p.WriteStructBegin("respNestedContainersMapSet"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respNestedContainersMapSet) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respNestedContainersMapSet) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respNestedContainersMapSet({") sb.WriteString("})") return sb.String() } type reqNestedContainersListMap struct { Foo []map[int32]int32 `thrift:"foo,1" json:"foo" db:"foo"` } // Compile time interface enforcer var _ thrift.Struct = &reqNestedContainersListMap{} // Deprecated: NestedContainersListMapArgsDeprecated is deprecated, since it is supposed to be internal. type NestedContainersListMapArgsDeprecated = reqNestedContainersListMap func newReqNestedContainersListMap() *reqNestedContainersListMap { return (&reqNestedContainersListMap{}). SetFooNonCompat(make([]map[int32]int32, 0)) } func (x *reqNestedContainersListMap) GetFooNonCompat() []map[int32]int32 { return x.Foo } func (x *reqNestedContainersListMap) GetFoo() []map[int32]int32 { if !x.IsSetFoo() { return make([]map[int32]int32, 0) } return x.Foo } func (x *reqNestedContainersListMap) SetFooNonCompat(value []map[int32]int32) *reqNestedContainersListMap { x.Foo = value return x } func (x *reqNestedContainersListMap) SetFoo(value []map[int32]int32) *reqNestedContainersListMap { x.Foo = value return x } func (x *reqNestedContainersListMap) IsSetFoo() bool { return x != nil && x.Foo != nil } func (x *reqNestedContainersListMap) writeField1(p thrift.Format) error { // Foo if err := p.WriteFieldBegin("foo", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetFooNonCompat() if err := p.WriteListBegin(thrift.MAP, len(item)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range item { { item := v if err := p.WriteMapBegin(thrift.I32, thrift.I32, len(item)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range item { { item := k if err := p.WriteI32(item); err != nil { return err } } { item := v if err := p.WriteI32(item); err != nil { return err } } } if err := p.WriteMapEnd(); err != nil { return thrift.PrependError("error writing map end: ", err) } } } if err := p.WriteListEnd(); err != nil { return thrift.PrependError("error writing list end: ", err) } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqNestedContainersListMap) readField1(p thrift.Format) error { // Foo _ /* elemType */, size, err := p.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } listResult := make([]map[int32]int32, 0, size) for i := 0; i < size; i++ { var elem map[int32]int32 { _ /* keyType */, _ /* valueType */, size, err := p.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } mapResult := make(map[int32]int32, size) for i := 0; i < size; i++ { var key int32 { result, err := p.ReadI32() if err != nil { return err } key = result } var value int32 { result, err := p.ReadI32() if err != nil { return err } value = result } mapResult[key] = value } if err := p.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } result := mapResult elem = result } listResult = append(listResult, elem) } if err := p.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } result := listResult x.SetFooNonCompat(result) return nil } func (x *reqNestedContainersListMap) toString1() string { // Foo return fmt.Sprintf("%v", x.GetFooNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListMap().Set().Set() type reqNestedContainersListMapBuilder struct { obj *reqNestedContainersListMap } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListMap().Set().Set() func newReqNestedContainersListMapBuilder() *reqNestedContainersListMapBuilder { return &reqNestedContainersListMapBuilder{ obj: newReqNestedContainersListMap(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListMap().Set().Set() func (x *reqNestedContainersListMapBuilder) Foo(value []map[int32]int32) *reqNestedContainersListMapBuilder { x.obj.Foo = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListMap().Set().Set() func (x *reqNestedContainersListMapBuilder) Emit() *reqNestedContainersListMap { var objCopy reqNestedContainersListMap = *x.obj return &objCopy } func (x *reqNestedContainersListMap) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqNestedContainersListMap"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqNestedContainersListMap) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.LIST)): // foo if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqNestedContainersListMap) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqNestedContainersListMap({") sb.WriteString(fmt.Sprintf("Foo:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respNestedContainersListMap struct { } // Compile time interface enforcer var _ thrift.Struct = &respNestedContainersListMap{} var _ thrift.WritableResult = &respNestedContainersListMap{} // Deprecated: NestedContainersListMapResultDeprecated is deprecated, since it is supposed to be internal. type NestedContainersListMapResultDeprecated = respNestedContainersListMap func newRespNestedContainersListMap() *respNestedContainersListMap { return (&respNestedContainersListMap{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersListMap().Set().Set() type respNestedContainersListMapBuilder struct { obj *respNestedContainersListMap } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersListMap().Set().Set() func newRespNestedContainersListMapBuilder() *respNestedContainersListMapBuilder { return &respNestedContainersListMapBuilder{ obj: newRespNestedContainersListMap(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersListMap().Set().Set() func (x *respNestedContainersListMapBuilder) Emit() *respNestedContainersListMap { var objCopy respNestedContainersListMap = *x.obj return &objCopy } func (x *respNestedContainersListMap) Exception() thrift.WritableException { return nil } func (x *respNestedContainersListMap) Write(p thrift.Format) error { if err := p.WriteStructBegin("respNestedContainersListMap"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respNestedContainersListMap) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respNestedContainersListMap) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respNestedContainersListMap({") sb.WriteString("})") return sb.String() } type reqNestedContainersListSet struct { Foo [][]int32 `thrift:"foo,1" json:"foo" db:"foo"` } // Compile time interface enforcer var _ thrift.Struct = &reqNestedContainersListSet{} // Deprecated: NestedContainersListSetArgsDeprecated is deprecated, since it is supposed to be internal. type NestedContainersListSetArgsDeprecated = reqNestedContainersListSet func newReqNestedContainersListSet() *reqNestedContainersListSet { return (&reqNestedContainersListSet{}). SetFooNonCompat(make([][]int32, 0)) } func (x *reqNestedContainersListSet) GetFooNonCompat() [][]int32 { return x.Foo } func (x *reqNestedContainersListSet) GetFoo() [][]int32 { if !x.IsSetFoo() { return make([][]int32, 0) } return x.Foo } func (x *reqNestedContainersListSet) SetFooNonCompat(value [][]int32) *reqNestedContainersListSet { x.Foo = value return x } func (x *reqNestedContainersListSet) SetFoo(value [][]int32) *reqNestedContainersListSet { x.Foo = value return x } func (x *reqNestedContainersListSet) IsSetFoo() bool { return x != nil && x.Foo != nil } func (x *reqNestedContainersListSet) writeField1(p thrift.Format) error { // Foo if err := p.WriteFieldBegin("foo", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetFooNonCompat() if err := p.WriteListBegin(thrift.SET, len(item)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range item { { item := v if err := p.WriteSetBegin(thrift.I32, len(item)); err != nil { return thrift.PrependError("error writing set begin: ", err) } for _, v := range item { { item := v if err := p.WriteI32(item); err != nil { return err } } } if err := p.WriteSetEnd(); err != nil { return thrift.PrependError("error writing set end: ", err) } } } if err := p.WriteListEnd(); err != nil { return thrift.PrependError("error writing list end: ", err) } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqNestedContainersListSet) readField1(p thrift.Format) error { // Foo _ /* elemType */, size, err := p.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } listResult := make([][]int32, 0, size) for i := 0; i < size; i++ { var elem []int32 { _ /* elemType */, size, err := p.ReadSetBegin() if err != nil { return thrift.PrependError("error reading set begin: ", err) } setResult := make([]int32, 0, size) for i := 0; i < size; i++ { var elem int32 { result, err := p.ReadI32() if err != nil { return err } elem = result } setResult = append(setResult, elem) } if err := p.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) } result := setResult elem = result } listResult = append(listResult, elem) } if err := p.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } result := listResult x.SetFooNonCompat(result) return nil } func (x *reqNestedContainersListSet) toString1() string { // Foo return fmt.Sprintf("%v", x.GetFooNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListSet().Set().Set() type reqNestedContainersListSetBuilder struct { obj *reqNestedContainersListSet } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListSet().Set().Set() func newReqNestedContainersListSetBuilder() *reqNestedContainersListSetBuilder { return &reqNestedContainersListSetBuilder{ obj: newReqNestedContainersListSet(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListSet().Set().Set() func (x *reqNestedContainersListSetBuilder) Foo(value [][]int32) *reqNestedContainersListSetBuilder { x.obj.Foo = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersListSet().Set().Set() func (x *reqNestedContainersListSetBuilder) Emit() *reqNestedContainersListSet { var objCopy reqNestedContainersListSet = *x.obj return &objCopy } func (x *reqNestedContainersListSet) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqNestedContainersListSet"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqNestedContainersListSet) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.LIST)): // foo if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqNestedContainersListSet) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqNestedContainersListSet({") sb.WriteString(fmt.Sprintf("Foo:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respNestedContainersListSet struct { } // Compile time interface enforcer var _ thrift.Struct = &respNestedContainersListSet{} var _ thrift.WritableResult = &respNestedContainersListSet{} // Deprecated: NestedContainersListSetResultDeprecated is deprecated, since it is supposed to be internal. type NestedContainersListSetResultDeprecated = respNestedContainersListSet func newRespNestedContainersListSet() *respNestedContainersListSet { return (&respNestedContainersListSet{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersListSet().Set().Set() type respNestedContainersListSetBuilder struct { obj *respNestedContainersListSet } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersListSet().Set().Set() func newRespNestedContainersListSetBuilder() *respNestedContainersListSetBuilder { return &respNestedContainersListSetBuilder{ obj: newRespNestedContainersListSet(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersListSet().Set().Set() func (x *respNestedContainersListSetBuilder) Emit() *respNestedContainersListSet { var objCopy respNestedContainersListSet = *x.obj return &objCopy } func (x *respNestedContainersListSet) Exception() thrift.WritableException { return nil } func (x *respNestedContainersListSet) Write(p thrift.Format) error { if err := p.WriteStructBegin("respNestedContainersListSet"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respNestedContainersListSet) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respNestedContainersListSet) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respNestedContainersListSet({") sb.WriteString("})") return sb.String() } type reqNestedContainersTurtles struct { Foo [][]map[int32]map[int32][]int32 `thrift:"foo,1" json:"foo" db:"foo"` } // Compile time interface enforcer var _ thrift.Struct = &reqNestedContainersTurtles{} // Deprecated: NestedContainersTurtlesArgsDeprecated is deprecated, since it is supposed to be internal. type NestedContainersTurtlesArgsDeprecated = reqNestedContainersTurtles func newReqNestedContainersTurtles() *reqNestedContainersTurtles { return (&reqNestedContainersTurtles{}). SetFooNonCompat(make([][]map[int32]map[int32][]int32, 0)) } func (x *reqNestedContainersTurtles) GetFooNonCompat() [][]map[int32]map[int32][]int32 { return x.Foo } func (x *reqNestedContainersTurtles) GetFoo() [][]map[int32]map[int32][]int32 { if !x.IsSetFoo() { return make([][]map[int32]map[int32][]int32, 0) } return x.Foo } func (x *reqNestedContainersTurtles) SetFooNonCompat(value [][]map[int32]map[int32][]int32) *reqNestedContainersTurtles { x.Foo = value return x } func (x *reqNestedContainersTurtles) SetFoo(value [][]map[int32]map[int32][]int32) *reqNestedContainersTurtles { x.Foo = value return x } func (x *reqNestedContainersTurtles) IsSetFoo() bool { return x != nil && x.Foo != nil } func (x *reqNestedContainersTurtles) writeField1(p thrift.Format) error { // Foo if err := p.WriteFieldBegin("foo", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error: ", x), err) } item := x.GetFooNonCompat() if err := p.WriteListBegin(thrift.LIST, len(item)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range item { { item := v if err := p.WriteListBegin(thrift.MAP, len(item)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range item { { item := v if err := p.WriteMapBegin(thrift.I32, thrift.MAP, len(item)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range item { { item := k if err := p.WriteI32(item); err != nil { return err } } { item := v if err := p.WriteMapBegin(thrift.I32, thrift.SET, len(item)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range item { { item := k if err := p.WriteI32(item); err != nil { return err } } { item := v if err := p.WriteSetBegin(thrift.I32, len(item)); err != nil { return thrift.PrependError("error writing set begin: ", err) } for _, v := range item { { item := v if err := p.WriteI32(item); err != nil { return err } } } if err := p.WriteSetEnd(); err != nil { return thrift.PrependError("error writing set end: ", err) } } } if err := p.WriteMapEnd(); err != nil { return thrift.PrependError("error writing map end: ", err) } } } if err := p.WriteMapEnd(); err != nil { return thrift.PrependError("error writing map end: ", err) } } } if err := p.WriteListEnd(); err != nil { return thrift.PrependError("error writing list end: ", err) } } } if err := p.WriteListEnd(); err != nil { return thrift.PrependError("error writing list end: ", err) } if err := p.WriteFieldEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error: ", x), err) } return nil } func (x *reqNestedContainersTurtles) readField1(p thrift.Format) error { // Foo _ /* elemType */, size, err := p.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } listResult := make([][]map[int32]map[int32][]int32, 0, size) for i := 0; i < size; i++ { var elem []map[int32]map[int32][]int32 { _ /* elemType */, size, err := p.ReadListBegin() if err != nil { return thrift.PrependError("error reading list begin: ", err) } listResult := make([]map[int32]map[int32][]int32, 0, size) for i := 0; i < size; i++ { var elem map[int32]map[int32][]int32 { _ /* keyType */, _ /* valueType */, size, err := p.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } mapResult := make(map[int32]map[int32][]int32, size) for i := 0; i < size; i++ { var key int32 { result, err := p.ReadI32() if err != nil { return err } key = result } var value map[int32][]int32 { _ /* keyType */, _ /* valueType */, size, err := p.ReadMapBegin() if err != nil { return thrift.PrependError("error reading map begin: ", err) } mapResult := make(map[int32][]int32, size) for i := 0; i < size; i++ { var key int32 { result, err := p.ReadI32() if err != nil { return err } key = result } var value []int32 { _ /* elemType */, size, err := p.ReadSetBegin() if err != nil { return thrift.PrependError("error reading set begin: ", err) } setResult := make([]int32, 0, size) for i := 0; i < size; i++ { var elem int32 { result, err := p.ReadI32() if err != nil { return err } elem = result } setResult = append(setResult, elem) } if err := p.ReadSetEnd(); err != nil { return thrift.PrependError("error reading set end: ", err) } result := setResult value = result } mapResult[key] = value } if err := p.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } result := mapResult value = result } mapResult[key] = value } if err := p.ReadMapEnd(); err != nil { return thrift.PrependError("error reading map end: ", err) } result := mapResult elem = result } listResult = append(listResult, elem) } if err := p.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } result := listResult elem = result } listResult = append(listResult, elem) } if err := p.ReadListEnd(); err != nil { return thrift.PrependError("error reading list end: ", err) } result := listResult x.SetFooNonCompat(result) return nil } func (x *reqNestedContainersTurtles) toString1() string { // Foo return fmt.Sprintf("%v", x.GetFooNonCompat()) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersTurtles().Set().Set() type reqNestedContainersTurtlesBuilder struct { obj *reqNestedContainersTurtles } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersTurtles().Set().Set() func newReqNestedContainersTurtlesBuilder() *reqNestedContainersTurtlesBuilder { return &reqNestedContainersTurtlesBuilder{ obj: newReqNestedContainersTurtles(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersTurtles().Set().Set() func (x *reqNestedContainersTurtlesBuilder) Foo(value [][]map[int32]map[int32][]int32) *reqNestedContainersTurtlesBuilder { x.obj.Foo = value return x } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newReqNestedContainersTurtles().Set().Set() func (x *reqNestedContainersTurtlesBuilder) Emit() *reqNestedContainersTurtles { var objCopy reqNestedContainersTurtles = *x.obj return &objCopy } func (x *reqNestedContainersTurtles) Write(p thrift.Format) error { if err := p.WriteStructBegin("reqNestedContainersTurtles"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := x.writeField1(p); err != nil { return err } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *reqNestedContainersTurtles) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { case (id == 1 && wireType == thrift.Type(thrift.LIST)): // foo if err := x.readField1(p); err != nil { return err } default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *reqNestedContainersTurtles) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("reqNestedContainersTurtles({") sb.WriteString(fmt.Sprintf("Foo:%s", x.toString1())) sb.WriteString("})") return sb.String() } type respNestedContainersTurtles struct { } // Compile time interface enforcer var _ thrift.Struct = &respNestedContainersTurtles{} var _ thrift.WritableResult = &respNestedContainersTurtles{} // Deprecated: NestedContainersTurtlesResultDeprecated is deprecated, since it is supposed to be internal. type NestedContainersTurtlesResultDeprecated = respNestedContainersTurtles func newRespNestedContainersTurtles() *respNestedContainersTurtles { return (&respNestedContainersTurtles{}) } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersTurtles().Set().Set() type respNestedContainersTurtlesBuilder struct { obj *respNestedContainersTurtles } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersTurtles().Set().Set() func newRespNestedContainersTurtlesBuilder() *respNestedContainersTurtlesBuilder { return &respNestedContainersTurtlesBuilder{ obj: newRespNestedContainersTurtles(), } } // Deprecated: Use "New" constructor and setters to build your structs. // e.g newRespNestedContainersTurtles().Set().Set() func (x *respNestedContainersTurtlesBuilder) Emit() *respNestedContainersTurtles { var objCopy respNestedContainersTurtles = *x.obj return &objCopy } func (x *respNestedContainersTurtles) Exception() thrift.WritableException { return nil } func (x *respNestedContainersTurtles) Write(p thrift.Format) error { if err := p.WriteStructBegin("respNestedContainersTurtles"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", x), err) } if err := p.WriteFieldStop(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", x), err) } if err := p.WriteStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", x), err) } return nil } func (x *respNestedContainersTurtles) Read(p thrift.Format) error { if _, err := p.ReadStructBegin(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", x), err) } for { _, wireType, id, err := p.ReadFieldBegin() if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", x, id), err) } if wireType == thrift.STOP { break; } switch { default: if err := p.Skip(wireType); err != nil { return err } } if err := p.ReadFieldEnd(); err != nil { return err } } if err := p.ReadStructEnd(); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", x), err) } return nil } func (x *respNestedContainersTurtles) String() string { if x == nil { return "" } var sb strings.Builder sb.WriteString("respNestedContainersTurtles({") sb.WriteString("})") return sb.String() } type NestedContainersProcessor struct { processorMap map[string]thrift.ProcessorFunctionContext functionServiceMap map[string]string handler NestedContainers } // Compile time interface enforcer var _ thrift.ProcessorContext = &NestedContainersProcessor{} func NewNestedContainersProcessor(handler NestedContainers) *NestedContainersProcessor { p := &NestedContainersProcessor{ handler: handler, processorMap: make(map[string]thrift.ProcessorFunctionContext), functionServiceMap: make(map[string]string), } p.AddToProcessorMap("mapList", &procFuncNestedContainersMapList{handler: handler}) p.AddToProcessorMap("mapSet", &procFuncNestedContainersMapSet{handler: handler}) p.AddToProcessorMap("listMap", &procFuncNestedContainersListMap{handler: handler}) p.AddToProcessorMap("listSet", &procFuncNestedContainersListSet{handler: handler}) p.AddToProcessorMap("turtles", &procFuncNestedContainersTurtles{handler: handler}) p.AddToFunctionServiceMap("mapList", "NestedContainers") p.AddToFunctionServiceMap("mapSet", "NestedContainers") p.AddToFunctionServiceMap("listMap", "NestedContainers") p.AddToFunctionServiceMap("listSet", "NestedContainers") p.AddToFunctionServiceMap("turtles", "NestedContainers") return p } func (p *NestedContainersProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { p.processorMap[key] = processor } func (p *NestedContainersProcessor) AddToFunctionServiceMap(key, service string) { p.functionServiceMap[key] = service } func (p *NestedContainersProcessor) GetProcessorFunctionContext(key string) (processor thrift.ProcessorFunctionContext, err error) { if processor, ok := p.processorMap[key]; ok { return processor, nil } return nil, nil } func (p *NestedContainersProcessor) ProcessorMap() map[string]thrift.ProcessorFunctionContext { return p.processorMap } func (p *NestedContainersProcessor) FunctionServiceMap() map[string]string { return p.functionServiceMap } func (p *NestedContainersProcessor) GetThriftMetadata() *metadata.ThriftMetadata { return GetThriftMetadataForService("module.NestedContainers") } type procFuncNestedContainersMapList struct { handler NestedContainers } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncNestedContainersMapList{} func (p *procFuncNestedContainersMapList) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqNestedContainersMapList() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncNestedContainersMapList) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("mapList", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { err = err2 } if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { err = err2 } if err2 = oprot.Flush(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncNestedContainersMapList) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqNestedContainersMapList) result := newRespNestedContainersMapList() err := p.handler.MapList(ctx, args.Foo) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing MapList: " + err.Error(), err) return x, x } return result, nil } type procFuncNestedContainersMapSet struct { handler NestedContainers } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncNestedContainersMapSet{} func (p *procFuncNestedContainersMapSet) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqNestedContainersMapSet() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncNestedContainersMapSet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("mapSet", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { err = err2 } if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { err = err2 } if err2 = oprot.Flush(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncNestedContainersMapSet) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqNestedContainersMapSet) result := newRespNestedContainersMapSet() err := p.handler.MapSet(ctx, args.Foo) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing MapSet: " + err.Error(), err) return x, x } return result, nil } type procFuncNestedContainersListMap struct { handler NestedContainers } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncNestedContainersListMap{} func (p *procFuncNestedContainersListMap) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqNestedContainersListMap() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncNestedContainersListMap) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("listMap", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { err = err2 } if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { err = err2 } if err2 = oprot.Flush(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncNestedContainersListMap) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqNestedContainersListMap) result := newRespNestedContainersListMap() err := p.handler.ListMap(ctx, args.Foo) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing ListMap: " + err.Error(), err) return x, x } return result, nil } type procFuncNestedContainersListSet struct { handler NestedContainers } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncNestedContainersListSet{} func (p *procFuncNestedContainersListSet) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqNestedContainersListSet() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncNestedContainersListSet) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("listSet", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { err = err2 } if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { err = err2 } if err2 = oprot.Flush(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncNestedContainersListSet) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqNestedContainersListSet) result := newRespNestedContainersListSet() err := p.handler.ListSet(ctx, args.Foo) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing ListSet: " + err.Error(), err) return x, x } return result, nil } type procFuncNestedContainersTurtles struct { handler NestedContainers } // Compile time interface enforcer var _ thrift.ProcessorFunctionContext = &procFuncNestedContainersTurtles{} func (p *procFuncNestedContainersTurtles) Read(iprot thrift.Format) (thrift.Struct, thrift.Exception) { args := newReqNestedContainersTurtles() if err := args.Read(iprot); err != nil { return nil, err } iprot.ReadMessageEnd() return args, nil } func (p *procFuncNestedContainersTurtles) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Format) (err thrift.Exception) { var err2 error messageType := thrift.REPLY switch result.(type) { case thrift.ApplicationException: messageType = thrift.EXCEPTION } if err2 = oprot.WriteMessageBegin("turtles", messageType, seqId); err2 != nil { err = err2 } if err2 = result.Write(oprot); err == nil && err2 != nil { err = err2 } if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { err = err2 } if err2 = oprot.Flush(); err == nil && err2 != nil { err = err2 } return err } func (p *procFuncNestedContainersTurtles) RunContext(ctx context.Context, reqStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { args := reqStruct.(*reqNestedContainersTurtles) result := newRespNestedContainersTurtles() err := p.handler.Turtles(ctx, args.Foo) if err != nil { x := thrift.NewApplicationExceptionCause(thrift.INTERNAL_ERROR, "Internal error processing Turtles: " + err.Error(), err) return x, x } return result, nil }