github.com/cloudwego/dynamicgo@v0.2.6-0.20240519101509-707f41b6b834/testdata/kitex_gen/pb/baseline/baselineservice/baselineservice.go (about)

     1  // Code generated by Kitex v0.5.2. DO NOT EDIT.
     2  
     3  package baselineservice
     4  
     5  import (
     6  	"context"
     7  	"fmt"
     8  	baseline "github.com/cloudwego/dynamicgo/testdata/kitex_gen/pb/baseline"
     9  	client "github.com/cloudwego/kitex/client"
    10  	kitex "github.com/cloudwego/kitex/pkg/serviceinfo"
    11  	streaming "github.com/cloudwego/kitex/pkg/streaming"
    12  	proto "google.golang.org/protobuf/proto"
    13  )
    14  
    15  func serviceInfo() *kitex.ServiceInfo {
    16  	return baselineServiceServiceInfo
    17  }
    18  
    19  var baselineServiceServiceInfo = NewServiceInfo()
    20  
    21  func NewServiceInfo() *kitex.ServiceInfo {
    22  	serviceName := "BaselineService"
    23  	handlerType := (*baseline.BaselineService)(nil)
    24  	methods := map[string]kitex.MethodInfo{
    25  		"SimpleMethod":         kitex.NewMethodInfo(simpleMethodHandler, newSimpleMethodArgs, newSimpleMethodResult, false),
    26  		"PartialSimpleMethod":  kitex.NewMethodInfo(partialSimpleMethodHandler, newPartialSimpleMethodArgs, newPartialSimpleMethodResult, false),
    27  		"NestingMethod":        kitex.NewMethodInfo(nestingMethodHandler, newNestingMethodArgs, newNestingMethodResult, false),
    28  		"PartialNestingMethod": kitex.NewMethodInfo(partialNestingMethodHandler, newPartialNestingMethodArgs, newPartialNestingMethodResult, false),
    29  		"Nesting2Method":       kitex.NewMethodInfo(nesting2MethodHandler, newNesting2MethodArgs, newNesting2MethodResult, false),
    30  	}
    31  	extra := map[string]interface{}{
    32  		"PackageName": "pb3",
    33  	}
    34  	svcInfo := &kitex.ServiceInfo{
    35  		ServiceName:     serviceName,
    36  		HandlerType:     handlerType,
    37  		Methods:         methods,
    38  		PayloadCodec:    kitex.Protobuf,
    39  		KiteXGenVersion: "v0.5.2",
    40  		Extra:           extra,
    41  	}
    42  	return svcInfo
    43  }
    44  
    45  func simpleMethodHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
    46  	switch s := arg.(type) {
    47  	case *streaming.Args:
    48  		st := s.Stream
    49  		req := new(baseline.Simple)
    50  		if err := st.RecvMsg(req); err != nil {
    51  			return err
    52  		}
    53  		resp, err := handler.(baseline.BaselineService).SimpleMethod(ctx, req)
    54  		if err != nil {
    55  			return err
    56  		}
    57  		if err := st.SendMsg(resp); err != nil {
    58  			return err
    59  		}
    60  	case *SimpleMethodArgs:
    61  		success, err := handler.(baseline.BaselineService).SimpleMethod(ctx, s.Req)
    62  		if err != nil {
    63  			return err
    64  		}
    65  		realResult := result.(*SimpleMethodResult)
    66  		realResult.Success = success
    67  	}
    68  	return nil
    69  }
    70  func newSimpleMethodArgs() interface{} {
    71  	return &SimpleMethodArgs{}
    72  }
    73  
    74  func newSimpleMethodResult() interface{} {
    75  	return &SimpleMethodResult{}
    76  }
    77  
    78  type SimpleMethodArgs struct {
    79  	Req *baseline.Simple
    80  }
    81  
    82  func (p *SimpleMethodArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
    83  	if !p.IsSetReq() {
    84  		p.Req = new(baseline.Simple)
    85  	}
    86  	return p.Req.FastRead(buf, _type, number)
    87  }
    88  
    89  func (p *SimpleMethodArgs) FastWrite(buf []byte) (n int) {
    90  	if !p.IsSetReq() {
    91  		return 0
    92  	}
    93  	return p.Req.FastWrite(buf)
    94  }
    95  
    96  func (p *SimpleMethodArgs) Size() (n int) {
    97  	if !p.IsSetReq() {
    98  		return 0
    99  	}
   100  	return p.Req.Size()
   101  }
   102  
   103  func (p *SimpleMethodArgs) Marshal(out []byte) ([]byte, error) {
   104  	if !p.IsSetReq() {
   105  		return out, fmt.Errorf("No req in SimpleMethodArgs")
   106  	}
   107  	return proto.Marshal(p.Req)
   108  }
   109  
   110  func (p *SimpleMethodArgs) Unmarshal(in []byte) error {
   111  	msg := new(baseline.Simple)
   112  	if err := proto.Unmarshal(in, msg); err != nil {
   113  		return err
   114  	}
   115  	p.Req = msg
   116  	return nil
   117  }
   118  
   119  var SimpleMethodArgs_Req_DEFAULT *baseline.Simple
   120  
   121  func (p *SimpleMethodArgs) GetReq() *baseline.Simple {
   122  	if !p.IsSetReq() {
   123  		return SimpleMethodArgs_Req_DEFAULT
   124  	}
   125  	return p.Req
   126  }
   127  
   128  func (p *SimpleMethodArgs) IsSetReq() bool {
   129  	return p.Req != nil
   130  }
   131  
   132  func (p *SimpleMethodArgs) GetFirstArgument() interface{} {
   133  	return p.Req
   134  }
   135  
   136  type SimpleMethodResult struct {
   137  	Success *baseline.Simple
   138  }
   139  
   140  var SimpleMethodResult_Success_DEFAULT *baseline.Simple
   141  
   142  func (p *SimpleMethodResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   143  	if !p.IsSetSuccess() {
   144  		p.Success = new(baseline.Simple)
   145  	}
   146  	return p.Success.FastRead(buf, _type, number)
   147  }
   148  
   149  func (p *SimpleMethodResult) FastWrite(buf []byte) (n int) {
   150  	if !p.IsSetSuccess() {
   151  		return 0
   152  	}
   153  	return p.Success.FastWrite(buf)
   154  }
   155  
   156  func (p *SimpleMethodResult) Size() (n int) {
   157  	if !p.IsSetSuccess() {
   158  		return 0
   159  	}
   160  	return p.Success.Size()
   161  }
   162  
   163  func (p *SimpleMethodResult) Marshal(out []byte) ([]byte, error) {
   164  	if !p.IsSetSuccess() {
   165  		return out, fmt.Errorf("No req in SimpleMethodResult")
   166  	}
   167  	return proto.Marshal(p.Success)
   168  }
   169  
   170  func (p *SimpleMethodResult) Unmarshal(in []byte) error {
   171  	msg := new(baseline.Simple)
   172  	if err := proto.Unmarshal(in, msg); err != nil {
   173  		return err
   174  	}
   175  	p.Success = msg
   176  	return nil
   177  }
   178  
   179  func (p *SimpleMethodResult) GetSuccess() *baseline.Simple {
   180  	if !p.IsSetSuccess() {
   181  		return SimpleMethodResult_Success_DEFAULT
   182  	}
   183  	return p.Success
   184  }
   185  
   186  func (p *SimpleMethodResult) SetSuccess(x interface{}) {
   187  	p.Success = x.(*baseline.Simple)
   188  }
   189  
   190  func (p *SimpleMethodResult) IsSetSuccess() bool {
   191  	return p.Success != nil
   192  }
   193  
   194  func (p *SimpleMethodResult) GetResult() interface{} {
   195  	return p.Success
   196  }
   197  
   198  func partialSimpleMethodHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
   199  	switch s := arg.(type) {
   200  	case *streaming.Args:
   201  		st := s.Stream
   202  		req := new(baseline.PartialSimple)
   203  		if err := st.RecvMsg(req); err != nil {
   204  			return err
   205  		}
   206  		resp, err := handler.(baseline.BaselineService).PartialSimpleMethod(ctx, req)
   207  		if err != nil {
   208  			return err
   209  		}
   210  		if err := st.SendMsg(resp); err != nil {
   211  			return err
   212  		}
   213  	case *PartialSimpleMethodArgs:
   214  		success, err := handler.(baseline.BaselineService).PartialSimpleMethod(ctx, s.Req)
   215  		if err != nil {
   216  			return err
   217  		}
   218  		realResult := result.(*PartialSimpleMethodResult)
   219  		realResult.Success = success
   220  	}
   221  	return nil
   222  }
   223  func newPartialSimpleMethodArgs() interface{} {
   224  	return &PartialSimpleMethodArgs{}
   225  }
   226  
   227  func newPartialSimpleMethodResult() interface{} {
   228  	return &PartialSimpleMethodResult{}
   229  }
   230  
   231  type PartialSimpleMethodArgs struct {
   232  	Req *baseline.PartialSimple
   233  }
   234  
   235  func (p *PartialSimpleMethodArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   236  	if !p.IsSetReq() {
   237  		p.Req = new(baseline.PartialSimple)
   238  	}
   239  	return p.Req.FastRead(buf, _type, number)
   240  }
   241  
   242  func (p *PartialSimpleMethodArgs) FastWrite(buf []byte) (n int) {
   243  	if !p.IsSetReq() {
   244  		return 0
   245  	}
   246  	return p.Req.FastWrite(buf)
   247  }
   248  
   249  func (p *PartialSimpleMethodArgs) Size() (n int) {
   250  	if !p.IsSetReq() {
   251  		return 0
   252  	}
   253  	return p.Req.Size()
   254  }
   255  
   256  func (p *PartialSimpleMethodArgs) Marshal(out []byte) ([]byte, error) {
   257  	if !p.IsSetReq() {
   258  		return out, fmt.Errorf("No req in PartialSimpleMethodArgs")
   259  	}
   260  	return proto.Marshal(p.Req)
   261  }
   262  
   263  func (p *PartialSimpleMethodArgs) Unmarshal(in []byte) error {
   264  	msg := new(baseline.PartialSimple)
   265  	if err := proto.Unmarshal(in, msg); err != nil {
   266  		return err
   267  	}
   268  	p.Req = msg
   269  	return nil
   270  }
   271  
   272  var PartialSimpleMethodArgs_Req_DEFAULT *baseline.PartialSimple
   273  
   274  func (p *PartialSimpleMethodArgs) GetReq() *baseline.PartialSimple {
   275  	if !p.IsSetReq() {
   276  		return PartialSimpleMethodArgs_Req_DEFAULT
   277  	}
   278  	return p.Req
   279  }
   280  
   281  func (p *PartialSimpleMethodArgs) IsSetReq() bool {
   282  	return p.Req != nil
   283  }
   284  
   285  func (p *PartialSimpleMethodArgs) GetFirstArgument() interface{} {
   286  	return p.Req
   287  }
   288  
   289  type PartialSimpleMethodResult struct {
   290  	Success *baseline.PartialSimple
   291  }
   292  
   293  var PartialSimpleMethodResult_Success_DEFAULT *baseline.PartialSimple
   294  
   295  func (p *PartialSimpleMethodResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   296  	if !p.IsSetSuccess() {
   297  		p.Success = new(baseline.PartialSimple)
   298  	}
   299  	return p.Success.FastRead(buf, _type, number)
   300  }
   301  
   302  func (p *PartialSimpleMethodResult) FastWrite(buf []byte) (n int) {
   303  	if !p.IsSetSuccess() {
   304  		return 0
   305  	}
   306  	return p.Success.FastWrite(buf)
   307  }
   308  
   309  func (p *PartialSimpleMethodResult) Size() (n int) {
   310  	if !p.IsSetSuccess() {
   311  		return 0
   312  	}
   313  	return p.Success.Size()
   314  }
   315  
   316  func (p *PartialSimpleMethodResult) Marshal(out []byte) ([]byte, error) {
   317  	if !p.IsSetSuccess() {
   318  		return out, fmt.Errorf("No req in PartialSimpleMethodResult")
   319  	}
   320  	return proto.Marshal(p.Success)
   321  }
   322  
   323  func (p *PartialSimpleMethodResult) Unmarshal(in []byte) error {
   324  	msg := new(baseline.PartialSimple)
   325  	if err := proto.Unmarshal(in, msg); err != nil {
   326  		return err
   327  	}
   328  	p.Success = msg
   329  	return nil
   330  }
   331  
   332  func (p *PartialSimpleMethodResult) GetSuccess() *baseline.PartialSimple {
   333  	if !p.IsSetSuccess() {
   334  		return PartialSimpleMethodResult_Success_DEFAULT
   335  	}
   336  	return p.Success
   337  }
   338  
   339  func (p *PartialSimpleMethodResult) SetSuccess(x interface{}) {
   340  	p.Success = x.(*baseline.PartialSimple)
   341  }
   342  
   343  func (p *PartialSimpleMethodResult) IsSetSuccess() bool {
   344  	return p.Success != nil
   345  }
   346  
   347  func (p *PartialSimpleMethodResult) GetResult() interface{} {
   348  	return p.Success
   349  }
   350  
   351  func nestingMethodHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
   352  	switch s := arg.(type) {
   353  	case *streaming.Args:
   354  		st := s.Stream
   355  		req := new(baseline.Nesting)
   356  		if err := st.RecvMsg(req); err != nil {
   357  			return err
   358  		}
   359  		resp, err := handler.(baseline.BaselineService).NestingMethod(ctx, req)
   360  		if err != nil {
   361  			return err
   362  		}
   363  		if err := st.SendMsg(resp); err != nil {
   364  			return err
   365  		}
   366  	case *NestingMethodArgs:
   367  		success, err := handler.(baseline.BaselineService).NestingMethod(ctx, s.Req)
   368  		if err != nil {
   369  			return err
   370  		}
   371  		realResult := result.(*NestingMethodResult)
   372  		realResult.Success = success
   373  	}
   374  	return nil
   375  }
   376  func newNestingMethodArgs() interface{} {
   377  	return &NestingMethodArgs{}
   378  }
   379  
   380  func newNestingMethodResult() interface{} {
   381  	return &NestingMethodResult{}
   382  }
   383  
   384  type NestingMethodArgs struct {
   385  	Req *baseline.Nesting
   386  }
   387  
   388  func (p *NestingMethodArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   389  	if !p.IsSetReq() {
   390  		p.Req = new(baseline.Nesting)
   391  	}
   392  	return p.Req.FastRead(buf, _type, number)
   393  }
   394  
   395  func (p *NestingMethodArgs) FastWrite(buf []byte) (n int) {
   396  	if !p.IsSetReq() {
   397  		return 0
   398  	}
   399  	return p.Req.FastWrite(buf)
   400  }
   401  
   402  func (p *NestingMethodArgs) Size() (n int) {
   403  	if !p.IsSetReq() {
   404  		return 0
   405  	}
   406  	return p.Req.Size()
   407  }
   408  
   409  func (p *NestingMethodArgs) Marshal(out []byte) ([]byte, error) {
   410  	if !p.IsSetReq() {
   411  		return out, fmt.Errorf("No req in NestingMethodArgs")
   412  	}
   413  	return proto.Marshal(p.Req)
   414  }
   415  
   416  func (p *NestingMethodArgs) Unmarshal(in []byte) error {
   417  	msg := new(baseline.Nesting)
   418  	if err := proto.Unmarshal(in, msg); err != nil {
   419  		return err
   420  	}
   421  	p.Req = msg
   422  	return nil
   423  }
   424  
   425  var NestingMethodArgs_Req_DEFAULT *baseline.Nesting
   426  
   427  func (p *NestingMethodArgs) GetReq() *baseline.Nesting {
   428  	if !p.IsSetReq() {
   429  		return NestingMethodArgs_Req_DEFAULT
   430  	}
   431  	return p.Req
   432  }
   433  
   434  func (p *NestingMethodArgs) IsSetReq() bool {
   435  	return p.Req != nil
   436  }
   437  
   438  func (p *NestingMethodArgs) GetFirstArgument() interface{} {
   439  	return p.Req
   440  }
   441  
   442  type NestingMethodResult struct {
   443  	Success *baseline.Nesting
   444  }
   445  
   446  var NestingMethodResult_Success_DEFAULT *baseline.Nesting
   447  
   448  func (p *NestingMethodResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   449  	if !p.IsSetSuccess() {
   450  		p.Success = new(baseline.Nesting)
   451  	}
   452  	return p.Success.FastRead(buf, _type, number)
   453  }
   454  
   455  func (p *NestingMethodResult) FastWrite(buf []byte) (n int) {
   456  	if !p.IsSetSuccess() {
   457  		return 0
   458  	}
   459  	return p.Success.FastWrite(buf)
   460  }
   461  
   462  func (p *NestingMethodResult) Size() (n int) {
   463  	if !p.IsSetSuccess() {
   464  		return 0
   465  	}
   466  	return p.Success.Size()
   467  }
   468  
   469  func (p *NestingMethodResult) Marshal(out []byte) ([]byte, error) {
   470  	if !p.IsSetSuccess() {
   471  		return out, fmt.Errorf("No req in NestingMethodResult")
   472  	}
   473  	return proto.Marshal(p.Success)
   474  }
   475  
   476  func (p *NestingMethodResult) Unmarshal(in []byte) error {
   477  	msg := new(baseline.Nesting)
   478  	if err := proto.Unmarshal(in, msg); err != nil {
   479  		return err
   480  	}
   481  	p.Success = msg
   482  	return nil
   483  }
   484  
   485  func (p *NestingMethodResult) GetSuccess() *baseline.Nesting {
   486  	if !p.IsSetSuccess() {
   487  		return NestingMethodResult_Success_DEFAULT
   488  	}
   489  	return p.Success
   490  }
   491  
   492  func (p *NestingMethodResult) SetSuccess(x interface{}) {
   493  	p.Success = x.(*baseline.Nesting)
   494  }
   495  
   496  func (p *NestingMethodResult) IsSetSuccess() bool {
   497  	return p.Success != nil
   498  }
   499  
   500  func (p *NestingMethodResult) GetResult() interface{} {
   501  	return p.Success
   502  }
   503  
   504  func partialNestingMethodHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
   505  	switch s := arg.(type) {
   506  	case *streaming.Args:
   507  		st := s.Stream
   508  		req := new(baseline.PartialNesting)
   509  		if err := st.RecvMsg(req); err != nil {
   510  			return err
   511  		}
   512  		resp, err := handler.(baseline.BaselineService).PartialNestingMethod(ctx, req)
   513  		if err != nil {
   514  			return err
   515  		}
   516  		if err := st.SendMsg(resp); err != nil {
   517  			return err
   518  		}
   519  	case *PartialNestingMethodArgs:
   520  		success, err := handler.(baseline.BaselineService).PartialNestingMethod(ctx, s.Req)
   521  		if err != nil {
   522  			return err
   523  		}
   524  		realResult := result.(*PartialNestingMethodResult)
   525  		realResult.Success = success
   526  	}
   527  	return nil
   528  }
   529  func newPartialNestingMethodArgs() interface{} {
   530  	return &PartialNestingMethodArgs{}
   531  }
   532  
   533  func newPartialNestingMethodResult() interface{} {
   534  	return &PartialNestingMethodResult{}
   535  }
   536  
   537  type PartialNestingMethodArgs struct {
   538  	Req *baseline.PartialNesting
   539  }
   540  
   541  func (p *PartialNestingMethodArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   542  	if !p.IsSetReq() {
   543  		p.Req = new(baseline.PartialNesting)
   544  	}
   545  	return p.Req.FastRead(buf, _type, number)
   546  }
   547  
   548  func (p *PartialNestingMethodArgs) FastWrite(buf []byte) (n int) {
   549  	if !p.IsSetReq() {
   550  		return 0
   551  	}
   552  	return p.Req.FastWrite(buf)
   553  }
   554  
   555  func (p *PartialNestingMethodArgs) Size() (n int) {
   556  	if !p.IsSetReq() {
   557  		return 0
   558  	}
   559  	return p.Req.Size()
   560  }
   561  
   562  func (p *PartialNestingMethodArgs) Marshal(out []byte) ([]byte, error) {
   563  	if !p.IsSetReq() {
   564  		return out, fmt.Errorf("No req in PartialNestingMethodArgs")
   565  	}
   566  	return proto.Marshal(p.Req)
   567  }
   568  
   569  func (p *PartialNestingMethodArgs) Unmarshal(in []byte) error {
   570  	msg := new(baseline.PartialNesting)
   571  	if err := proto.Unmarshal(in, msg); err != nil {
   572  		return err
   573  	}
   574  	p.Req = msg
   575  	return nil
   576  }
   577  
   578  var PartialNestingMethodArgs_Req_DEFAULT *baseline.PartialNesting
   579  
   580  func (p *PartialNestingMethodArgs) GetReq() *baseline.PartialNesting {
   581  	if !p.IsSetReq() {
   582  		return PartialNestingMethodArgs_Req_DEFAULT
   583  	}
   584  	return p.Req
   585  }
   586  
   587  func (p *PartialNestingMethodArgs) IsSetReq() bool {
   588  	return p.Req != nil
   589  }
   590  
   591  func (p *PartialNestingMethodArgs) GetFirstArgument() interface{} {
   592  	return p.Req
   593  }
   594  
   595  type PartialNestingMethodResult struct {
   596  	Success *baseline.PartialNesting
   597  }
   598  
   599  var PartialNestingMethodResult_Success_DEFAULT *baseline.PartialNesting
   600  
   601  func (p *PartialNestingMethodResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   602  	if !p.IsSetSuccess() {
   603  		p.Success = new(baseline.PartialNesting)
   604  	}
   605  	return p.Success.FastRead(buf, _type, number)
   606  }
   607  
   608  func (p *PartialNestingMethodResult) FastWrite(buf []byte) (n int) {
   609  	if !p.IsSetSuccess() {
   610  		return 0
   611  	}
   612  	return p.Success.FastWrite(buf)
   613  }
   614  
   615  func (p *PartialNestingMethodResult) Size() (n int) {
   616  	if !p.IsSetSuccess() {
   617  		return 0
   618  	}
   619  	return p.Success.Size()
   620  }
   621  
   622  func (p *PartialNestingMethodResult) Marshal(out []byte) ([]byte, error) {
   623  	if !p.IsSetSuccess() {
   624  		return out, fmt.Errorf("No req in PartialNestingMethodResult")
   625  	}
   626  	return proto.Marshal(p.Success)
   627  }
   628  
   629  func (p *PartialNestingMethodResult) Unmarshal(in []byte) error {
   630  	msg := new(baseline.PartialNesting)
   631  	if err := proto.Unmarshal(in, msg); err != nil {
   632  		return err
   633  	}
   634  	p.Success = msg
   635  	return nil
   636  }
   637  
   638  func (p *PartialNestingMethodResult) GetSuccess() *baseline.PartialNesting {
   639  	if !p.IsSetSuccess() {
   640  		return PartialNestingMethodResult_Success_DEFAULT
   641  	}
   642  	return p.Success
   643  }
   644  
   645  func (p *PartialNestingMethodResult) SetSuccess(x interface{}) {
   646  	p.Success = x.(*baseline.PartialNesting)
   647  }
   648  
   649  func (p *PartialNestingMethodResult) IsSetSuccess() bool {
   650  	return p.Success != nil
   651  }
   652  
   653  func (p *PartialNestingMethodResult) GetResult() interface{} {
   654  	return p.Success
   655  }
   656  
   657  func nesting2MethodHandler(ctx context.Context, handler interface{}, arg, result interface{}) error {
   658  	switch s := arg.(type) {
   659  	case *streaming.Args:
   660  		st := s.Stream
   661  		req := new(baseline.Nesting2)
   662  		if err := st.RecvMsg(req); err != nil {
   663  			return err
   664  		}
   665  		resp, err := handler.(baseline.BaselineService).Nesting2Method(ctx, req)
   666  		if err != nil {
   667  			return err
   668  		}
   669  		if err := st.SendMsg(resp); err != nil {
   670  			return err
   671  		}
   672  	case *Nesting2MethodArgs:
   673  		success, err := handler.(baseline.BaselineService).Nesting2Method(ctx, s.Req)
   674  		if err != nil {
   675  			return err
   676  		}
   677  		realResult := result.(*Nesting2MethodResult)
   678  		realResult.Success = success
   679  	}
   680  	return nil
   681  }
   682  func newNesting2MethodArgs() interface{} {
   683  	return &Nesting2MethodArgs{}
   684  }
   685  
   686  func newNesting2MethodResult() interface{} {
   687  	return &Nesting2MethodResult{}
   688  }
   689  
   690  type Nesting2MethodArgs struct {
   691  	Req *baseline.Nesting2
   692  }
   693  
   694  func (p *Nesting2MethodArgs) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   695  	if !p.IsSetReq() {
   696  		p.Req = new(baseline.Nesting2)
   697  	}
   698  	return p.Req.FastRead(buf, _type, number)
   699  }
   700  
   701  func (p *Nesting2MethodArgs) FastWrite(buf []byte) (n int) {
   702  	if !p.IsSetReq() {
   703  		return 0
   704  	}
   705  	return p.Req.FastWrite(buf)
   706  }
   707  
   708  func (p *Nesting2MethodArgs) Size() (n int) {
   709  	if !p.IsSetReq() {
   710  		return 0
   711  	}
   712  	return p.Req.Size()
   713  }
   714  
   715  func (p *Nesting2MethodArgs) Marshal(out []byte) ([]byte, error) {
   716  	if !p.IsSetReq() {
   717  		return out, fmt.Errorf("No req in Nesting2MethodArgs")
   718  	}
   719  	return proto.Marshal(p.Req)
   720  }
   721  
   722  func (p *Nesting2MethodArgs) Unmarshal(in []byte) error {
   723  	msg := new(baseline.Nesting2)
   724  	if err := proto.Unmarshal(in, msg); err != nil {
   725  		return err
   726  	}
   727  	p.Req = msg
   728  	return nil
   729  }
   730  
   731  var Nesting2MethodArgs_Req_DEFAULT *baseline.Nesting2
   732  
   733  func (p *Nesting2MethodArgs) GetReq() *baseline.Nesting2 {
   734  	if !p.IsSetReq() {
   735  		return Nesting2MethodArgs_Req_DEFAULT
   736  	}
   737  	return p.Req
   738  }
   739  
   740  func (p *Nesting2MethodArgs) IsSetReq() bool {
   741  	return p.Req != nil
   742  }
   743  
   744  func (p *Nesting2MethodArgs) GetFirstArgument() interface{} {
   745  	return p.Req
   746  }
   747  
   748  type Nesting2MethodResult struct {
   749  	Success *baseline.Nesting2
   750  }
   751  
   752  var Nesting2MethodResult_Success_DEFAULT *baseline.Nesting2
   753  
   754  func (p *Nesting2MethodResult) FastRead(buf []byte, _type int8, number int32) (n int, err error) {
   755  	if !p.IsSetSuccess() {
   756  		p.Success = new(baseline.Nesting2)
   757  	}
   758  	return p.Success.FastRead(buf, _type, number)
   759  }
   760  
   761  func (p *Nesting2MethodResult) FastWrite(buf []byte) (n int) {
   762  	if !p.IsSetSuccess() {
   763  		return 0
   764  	}
   765  	return p.Success.FastWrite(buf)
   766  }
   767  
   768  func (p *Nesting2MethodResult) Size() (n int) {
   769  	if !p.IsSetSuccess() {
   770  		return 0
   771  	}
   772  	return p.Success.Size()
   773  }
   774  
   775  func (p *Nesting2MethodResult) Marshal(out []byte) ([]byte, error) {
   776  	if !p.IsSetSuccess() {
   777  		return out, fmt.Errorf("No req in Nesting2MethodResult")
   778  	}
   779  	return proto.Marshal(p.Success)
   780  }
   781  
   782  func (p *Nesting2MethodResult) Unmarshal(in []byte) error {
   783  	msg := new(baseline.Nesting2)
   784  	if err := proto.Unmarshal(in, msg); err != nil {
   785  		return err
   786  	}
   787  	p.Success = msg
   788  	return nil
   789  }
   790  
   791  func (p *Nesting2MethodResult) GetSuccess() *baseline.Nesting2 {
   792  	if !p.IsSetSuccess() {
   793  		return Nesting2MethodResult_Success_DEFAULT
   794  	}
   795  	return p.Success
   796  }
   797  
   798  func (p *Nesting2MethodResult) SetSuccess(x interface{}) {
   799  	p.Success = x.(*baseline.Nesting2)
   800  }
   801  
   802  func (p *Nesting2MethodResult) IsSetSuccess() bool {
   803  	return p.Success != nil
   804  }
   805  
   806  func (p *Nesting2MethodResult) GetResult() interface{} {
   807  	return p.Success
   808  }
   809  
   810  type kClient struct {
   811  	c client.Client
   812  }
   813  
   814  func newServiceClient(c client.Client) *kClient {
   815  	return &kClient{
   816  		c: c,
   817  	}
   818  }
   819  
   820  func (p *kClient) SimpleMethod(ctx context.Context, Req *baseline.Simple) (r *baseline.Simple, err error) {
   821  	var _args SimpleMethodArgs
   822  	_args.Req = Req
   823  	var _result SimpleMethodResult
   824  	if err = p.c.Call(ctx, "SimpleMethod", &_args, &_result); err != nil {
   825  		return
   826  	}
   827  	return _result.GetSuccess(), nil
   828  }
   829  
   830  func (p *kClient) PartialSimpleMethod(ctx context.Context, Req *baseline.PartialSimple) (r *baseline.PartialSimple, err error) {
   831  	var _args PartialSimpleMethodArgs
   832  	_args.Req = Req
   833  	var _result PartialSimpleMethodResult
   834  	if err = p.c.Call(ctx, "PartialSimpleMethod", &_args, &_result); err != nil {
   835  		return
   836  	}
   837  	return _result.GetSuccess(), nil
   838  }
   839  
   840  func (p *kClient) NestingMethod(ctx context.Context, Req *baseline.Nesting) (r *baseline.Nesting, err error) {
   841  	var _args NestingMethodArgs
   842  	_args.Req = Req
   843  	var _result NestingMethodResult
   844  	if err = p.c.Call(ctx, "NestingMethod", &_args, &_result); err != nil {
   845  		return
   846  	}
   847  	return _result.GetSuccess(), nil
   848  }
   849  
   850  func (p *kClient) PartialNestingMethod(ctx context.Context, Req *baseline.PartialNesting) (r *baseline.PartialNesting, err error) {
   851  	var _args PartialNestingMethodArgs
   852  	_args.Req = Req
   853  	var _result PartialNestingMethodResult
   854  	if err = p.c.Call(ctx, "PartialNestingMethod", &_args, &_result); err != nil {
   855  		return
   856  	}
   857  	return _result.GetSuccess(), nil
   858  }
   859  
   860  func (p *kClient) Nesting2Method(ctx context.Context, Req *baseline.Nesting2) (r *baseline.Nesting2, err error) {
   861  	var _args Nesting2MethodArgs
   862  	_args.Req = Req
   863  	var _result Nesting2MethodResult
   864  	if err = p.c.Call(ctx, "Nesting2Method", &_args, &_result); err != nil {
   865  		return
   866  	}
   867  	return _result.GetSuccess(), nil
   868  }