github.com/s7techlab/cckit@v0.10.5/examples/fabcar/fabcar.pb.cc.go (about) 1 // Code generated by protoc-gen-cc-gateway. DO NOT EDIT. 2 // source: fabcar/fabcar.proto 3 4 /* 5 Package fabcar contains 6 * chaincode methods names {service_name}Chaincode_{method_name} 7 * chaincode interface definition {service_name}Chaincode 8 * chaincode gateway definition {service_name}}Gateway 9 * chaincode service to cckit router registration func 10 */ 11 package fabcar 12 13 import ( 14 context "context" 15 _ "embed" 16 errors "errors" 17 18 cckit_gateway "github.com/s7techlab/cckit/gateway" 19 cckit_router "github.com/s7techlab/cckit/router" 20 cckit_defparam "github.com/s7techlab/cckit/router/param/defparam" 21 cckit_sdk "github.com/s7techlab/cckit/sdk" 22 "google.golang.org/protobuf/types/known/emptypb" 23 ) 24 25 // FabCarServiceChaincode method names 26 const ( 27 28 // FabCarServiceChaincodeMethodPrefix allows to use multiple services with same method names in one chaincode 29 FabCarServiceChaincodeMethodPrefix = "" 30 31 FabCarServiceChaincode_CreateMaker = FabCarServiceChaincodeMethodPrefix + "CreateMaker" 32 33 FabCarServiceChaincode_DeleteMaker = FabCarServiceChaincodeMethodPrefix + "DeleteMaker" 34 35 FabCarServiceChaincode_GetMaker = FabCarServiceChaincodeMethodPrefix + "GetMaker" 36 37 FabCarServiceChaincode_ListMakers = FabCarServiceChaincodeMethodPrefix + "ListMakers" 38 39 FabCarServiceChaincode_CreateCar = FabCarServiceChaincodeMethodPrefix + "CreateCar" 40 41 FabCarServiceChaincode_UpdateCar = FabCarServiceChaincodeMethodPrefix + "UpdateCar" 42 43 FabCarServiceChaincode_DeleteCar = FabCarServiceChaincodeMethodPrefix + "DeleteCar" 44 45 FabCarServiceChaincode_GetCar = FabCarServiceChaincodeMethodPrefix + "GetCar" 46 47 FabCarServiceChaincode_GetCarView = FabCarServiceChaincodeMethodPrefix + "GetCarView" 48 49 FabCarServiceChaincode_ListCars = FabCarServiceChaincodeMethodPrefix + "ListCars" 50 51 FabCarServiceChaincode_UpdateCarOwners = FabCarServiceChaincodeMethodPrefix + "UpdateCarOwners" 52 53 FabCarServiceChaincode_DeleteCarOwner = FabCarServiceChaincodeMethodPrefix + "DeleteCarOwner" 54 55 FabCarServiceChaincode_GetCarOwner = FabCarServiceChaincodeMethodPrefix + "GetCarOwner" 56 57 FabCarServiceChaincode_ListCarOwners = FabCarServiceChaincodeMethodPrefix + "ListCarOwners" 58 59 FabCarServiceChaincode_UpdateCarDetails = FabCarServiceChaincodeMethodPrefix + "UpdateCarDetails" 60 61 FabCarServiceChaincode_DeleteCarDetail = FabCarServiceChaincodeMethodPrefix + "DeleteCarDetail" 62 63 FabCarServiceChaincode_GetCarDetail = FabCarServiceChaincodeMethodPrefix + "GetCarDetail" 64 65 FabCarServiceChaincode_ListCarDetails = FabCarServiceChaincodeMethodPrefix + "ListCarDetails" 66 ) 67 68 // FabCarServiceChaincode chaincode methods interface 69 type FabCarServiceChaincode interface { 70 CreateMaker(cckit_router.Context, *CreateMakerRequest) (*Maker, error) 71 72 DeleteMaker(cckit_router.Context, *MakerName) (*Maker, error) 73 74 GetMaker(cckit_router.Context, *MakerName) (*Maker, error) 75 76 ListMakers(cckit_router.Context, *emptypb.Empty) (*Makers, error) 77 78 CreateCar(cckit_router.Context, *CreateCarRequest) (*CarView, error) 79 80 UpdateCar(cckit_router.Context, *UpdateCarRequest) (*CarView, error) 81 82 DeleteCar(cckit_router.Context, *CarId) (*CarView, error) 83 84 GetCar(cckit_router.Context, *CarId) (*Car, error) 85 86 GetCarView(cckit_router.Context, *CarId) (*CarView, error) 87 88 ListCars(cckit_router.Context, *emptypb.Empty) (*Cars, error) 89 90 UpdateCarOwners(cckit_router.Context, *UpdateCarOwnersRequest) (*CarOwners, error) 91 92 DeleteCarOwner(cckit_router.Context, *CarOwnerId) (*CarOwner, error) 93 94 GetCarOwner(cckit_router.Context, *CarOwnerId) (*CarOwner, error) 95 96 ListCarOwners(cckit_router.Context, *CarId) (*CarOwners, error) 97 98 UpdateCarDetails(cckit_router.Context, *UpdateCarDetailsRequest) (*CarDetails, error) 99 100 DeleteCarDetail(cckit_router.Context, *CarDetailId) (*CarDetail, error) 101 102 GetCarDetail(cckit_router.Context, *CarDetailId) (*CarDetail, error) 103 104 ListCarDetails(cckit_router.Context, *CarId) (*CarDetails, error) 105 } 106 107 // RegisterFabCarServiceChaincode registers service methods as chaincode router handlers 108 func RegisterFabCarServiceChaincode(r *cckit_router.Group, cc FabCarServiceChaincode) error { 109 110 r.Invoke(FabCarServiceChaincode_CreateMaker, 111 func(ctx cckit_router.Context) (interface{}, error) { 112 return cc.CreateMaker(ctx, ctx.Param().(*CreateMakerRequest)) 113 }, 114 cckit_defparam.Proto(&CreateMakerRequest{})) 115 116 r.Invoke(FabCarServiceChaincode_DeleteMaker, 117 func(ctx cckit_router.Context) (interface{}, error) { 118 return cc.DeleteMaker(ctx, ctx.Param().(*MakerName)) 119 }, 120 cckit_defparam.Proto(&MakerName{})) 121 122 r.Query(FabCarServiceChaincode_GetMaker, 123 func(ctx cckit_router.Context) (interface{}, error) { 124 return cc.GetMaker(ctx, ctx.Param().(*MakerName)) 125 }, 126 cckit_defparam.Proto(&MakerName{})) 127 128 r.Query(FabCarServiceChaincode_ListMakers, 129 func(ctx cckit_router.Context) (interface{}, error) { 130 return cc.ListMakers(ctx, ctx.Param().(*emptypb.Empty)) 131 }, 132 cckit_defparam.Proto(&emptypb.Empty{})) 133 134 r.Invoke(FabCarServiceChaincode_CreateCar, 135 func(ctx cckit_router.Context) (interface{}, error) { 136 return cc.CreateCar(ctx, ctx.Param().(*CreateCarRequest)) 137 }, 138 cckit_defparam.Proto(&CreateCarRequest{})) 139 140 r.Invoke(FabCarServiceChaincode_UpdateCar, 141 func(ctx cckit_router.Context) (interface{}, error) { 142 return cc.UpdateCar(ctx, ctx.Param().(*UpdateCarRequest)) 143 }, 144 cckit_defparam.Proto(&UpdateCarRequest{})) 145 146 r.Invoke(FabCarServiceChaincode_DeleteCar, 147 func(ctx cckit_router.Context) (interface{}, error) { 148 return cc.DeleteCar(ctx, ctx.Param().(*CarId)) 149 }, 150 cckit_defparam.Proto(&CarId{})) 151 152 r.Query(FabCarServiceChaincode_GetCar, 153 func(ctx cckit_router.Context) (interface{}, error) { 154 return cc.GetCar(ctx, ctx.Param().(*CarId)) 155 }, 156 cckit_defparam.Proto(&CarId{})) 157 158 r.Query(FabCarServiceChaincode_GetCarView, 159 func(ctx cckit_router.Context) (interface{}, error) { 160 return cc.GetCarView(ctx, ctx.Param().(*CarId)) 161 }, 162 cckit_defparam.Proto(&CarId{})) 163 164 r.Query(FabCarServiceChaincode_ListCars, 165 func(ctx cckit_router.Context) (interface{}, error) { 166 return cc.ListCars(ctx, ctx.Param().(*emptypb.Empty)) 167 }, 168 cckit_defparam.Proto(&emptypb.Empty{})) 169 170 r.Invoke(FabCarServiceChaincode_UpdateCarOwners, 171 func(ctx cckit_router.Context) (interface{}, error) { 172 return cc.UpdateCarOwners(ctx, ctx.Param().(*UpdateCarOwnersRequest)) 173 }, 174 cckit_defparam.Proto(&UpdateCarOwnersRequest{})) 175 176 r.Invoke(FabCarServiceChaincode_DeleteCarOwner, 177 func(ctx cckit_router.Context) (interface{}, error) { 178 return cc.DeleteCarOwner(ctx, ctx.Param().(*CarOwnerId)) 179 }, 180 cckit_defparam.Proto(&CarOwnerId{})) 181 182 r.Query(FabCarServiceChaincode_GetCarOwner, 183 func(ctx cckit_router.Context) (interface{}, error) { 184 return cc.GetCarOwner(ctx, ctx.Param().(*CarOwnerId)) 185 }, 186 cckit_defparam.Proto(&CarOwnerId{})) 187 188 r.Query(FabCarServiceChaincode_ListCarOwners, 189 func(ctx cckit_router.Context) (interface{}, error) { 190 return cc.ListCarOwners(ctx, ctx.Param().(*CarId)) 191 }, 192 cckit_defparam.Proto(&CarId{})) 193 194 r.Invoke(FabCarServiceChaincode_UpdateCarDetails, 195 func(ctx cckit_router.Context) (interface{}, error) { 196 return cc.UpdateCarDetails(ctx, ctx.Param().(*UpdateCarDetailsRequest)) 197 }, 198 cckit_defparam.Proto(&UpdateCarDetailsRequest{})) 199 200 r.Invoke(FabCarServiceChaincode_DeleteCarDetail, 201 func(ctx cckit_router.Context) (interface{}, error) { 202 return cc.DeleteCarDetail(ctx, ctx.Param().(*CarDetailId)) 203 }, 204 cckit_defparam.Proto(&CarDetailId{})) 205 206 r.Query(FabCarServiceChaincode_GetCarDetail, 207 func(ctx cckit_router.Context) (interface{}, error) { 208 return cc.GetCarDetail(ctx, ctx.Param().(*CarDetailId)) 209 }, 210 cckit_defparam.Proto(&CarDetailId{})) 211 212 r.Query(FabCarServiceChaincode_ListCarDetails, 213 func(ctx cckit_router.Context) (interface{}, error) { 214 return cc.ListCarDetails(ctx, ctx.Param().(*CarId)) 215 }, 216 cckit_defparam.Proto(&CarId{})) 217 218 return nil 219 } 220 221 //go:embed fabcar.swagger.json 222 var FabCarServiceSwagger []byte 223 224 // NewFabCarServiceGateway creates gateway to access chaincode method via chaincode service 225 func NewFabCarServiceGateway(sdk cckit_sdk.SDK, channel, chaincode string, opts ...cckit_gateway.Opt) *FabCarServiceGateway { 226 return NewFabCarServiceGatewayFromInstance( 227 cckit_gateway.NewChaincodeInstanceService( 228 sdk, 229 &cckit_gateway.ChaincodeLocator{Channel: channel, Chaincode: chaincode}, 230 opts..., 231 )) 232 } 233 234 func NewFabCarServiceGatewayFromInstance(chaincodeInstance cckit_gateway.ChaincodeInstance) *FabCarServiceGateway { 235 return &FabCarServiceGateway{ 236 ChaincodeInstance: chaincodeInstance, 237 } 238 } 239 240 // gateway implementation 241 // gateway can be used as kind of SDK, GRPC or REST server ( via grpc-gateway or clay ) 242 type FabCarServiceGateway struct { 243 ChaincodeInstance cckit_gateway.ChaincodeInstance 244 } 245 246 func (c *FabCarServiceGateway) Invoker() cckit_gateway.ChaincodeInstanceInvoker { 247 return cckit_gateway.NewChaincodeInstanceServiceInvoker(c.ChaincodeInstance) 248 } 249 250 // ServiceDef returns service definition 251 func (c *FabCarServiceGateway) ServiceDef() cckit_gateway.ServiceDef { 252 return cckit_gateway.NewServiceDef( 253 _FabCarService_serviceDesc.ServiceName, 254 FabCarServiceSwagger, 255 &_FabCarService_serviceDesc, 256 c, 257 RegisterFabCarServiceHandlerFromEndpoint, 258 ) 259 } 260 261 func (c *FabCarServiceGateway) CreateMaker(ctx context.Context, in *CreateMakerRequest) (*Maker, error) { 262 var inMsg interface{} = in 263 if v, ok := inMsg.(interface{ Validate() error }); ok { 264 if err := v.Validate(); err != nil { 265 return nil, err 266 } 267 } 268 269 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_CreateMaker, []interface{}{in}, &Maker{}); err != nil { 270 return nil, err 271 } else { 272 return res.(*Maker), nil 273 } 274 } 275 276 func (c *FabCarServiceGateway) DeleteMaker(ctx context.Context, in *MakerName) (*Maker, error) { 277 var inMsg interface{} = in 278 if v, ok := inMsg.(interface{ Validate() error }); ok { 279 if err := v.Validate(); err != nil { 280 return nil, err 281 } 282 } 283 284 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_DeleteMaker, []interface{}{in}, &Maker{}); err != nil { 285 return nil, err 286 } else { 287 return res.(*Maker), nil 288 } 289 } 290 291 func (c *FabCarServiceGateway) GetMaker(ctx context.Context, in *MakerName) (*Maker, error) { 292 var inMsg interface{} = in 293 if v, ok := inMsg.(interface{ Validate() error }); ok { 294 if err := v.Validate(); err != nil { 295 return nil, err 296 } 297 } 298 299 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_GetMaker, []interface{}{in}, &Maker{}); err != nil { 300 return nil, err 301 } else { 302 return res.(*Maker), nil 303 } 304 } 305 306 func (c *FabCarServiceGateway) ListMakers(ctx context.Context, in *emptypb.Empty) (*Makers, error) { 307 var inMsg interface{} = in 308 if v, ok := inMsg.(interface{ Validate() error }); ok { 309 if err := v.Validate(); err != nil { 310 return nil, err 311 } 312 } 313 314 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_ListMakers, []interface{}{in}, &Makers{}); err != nil { 315 return nil, err 316 } else { 317 return res.(*Makers), nil 318 } 319 } 320 321 func (c *FabCarServiceGateway) CreateCar(ctx context.Context, in *CreateCarRequest) (*CarView, error) { 322 var inMsg interface{} = in 323 if v, ok := inMsg.(interface{ Validate() error }); ok { 324 if err := v.Validate(); err != nil { 325 return nil, err 326 } 327 } 328 329 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_CreateCar, []interface{}{in}, &CarView{}); err != nil { 330 return nil, err 331 } else { 332 return res.(*CarView), nil 333 } 334 } 335 336 func (c *FabCarServiceGateway) UpdateCar(ctx context.Context, in *UpdateCarRequest) (*CarView, error) { 337 var inMsg interface{} = in 338 if v, ok := inMsg.(interface{ Validate() error }); ok { 339 if err := v.Validate(); err != nil { 340 return nil, err 341 } 342 } 343 344 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_UpdateCar, []interface{}{in}, &CarView{}); err != nil { 345 return nil, err 346 } else { 347 return res.(*CarView), nil 348 } 349 } 350 351 func (c *FabCarServiceGateway) DeleteCar(ctx context.Context, in *CarId) (*CarView, error) { 352 var inMsg interface{} = in 353 if v, ok := inMsg.(interface{ Validate() error }); ok { 354 if err := v.Validate(); err != nil { 355 return nil, err 356 } 357 } 358 359 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_DeleteCar, []interface{}{in}, &CarView{}); err != nil { 360 return nil, err 361 } else { 362 return res.(*CarView), nil 363 } 364 } 365 366 func (c *FabCarServiceGateway) GetCar(ctx context.Context, in *CarId) (*Car, error) { 367 var inMsg interface{} = in 368 if v, ok := inMsg.(interface{ Validate() error }); ok { 369 if err := v.Validate(); err != nil { 370 return nil, err 371 } 372 } 373 374 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_GetCar, []interface{}{in}, &Car{}); err != nil { 375 return nil, err 376 } else { 377 return res.(*Car), nil 378 } 379 } 380 381 func (c *FabCarServiceGateway) GetCarView(ctx context.Context, in *CarId) (*CarView, error) { 382 var inMsg interface{} = in 383 if v, ok := inMsg.(interface{ Validate() error }); ok { 384 if err := v.Validate(); err != nil { 385 return nil, err 386 } 387 } 388 389 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_GetCarView, []interface{}{in}, &CarView{}); err != nil { 390 return nil, err 391 } else { 392 return res.(*CarView), nil 393 } 394 } 395 396 func (c *FabCarServiceGateway) ListCars(ctx context.Context, in *emptypb.Empty) (*Cars, error) { 397 var inMsg interface{} = in 398 if v, ok := inMsg.(interface{ Validate() error }); ok { 399 if err := v.Validate(); err != nil { 400 return nil, err 401 } 402 } 403 404 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_ListCars, []interface{}{in}, &Cars{}); err != nil { 405 return nil, err 406 } else { 407 return res.(*Cars), nil 408 } 409 } 410 411 func (c *FabCarServiceGateway) UpdateCarOwners(ctx context.Context, in *UpdateCarOwnersRequest) (*CarOwners, error) { 412 var inMsg interface{} = in 413 if v, ok := inMsg.(interface{ Validate() error }); ok { 414 if err := v.Validate(); err != nil { 415 return nil, err 416 } 417 } 418 419 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_UpdateCarOwners, []interface{}{in}, &CarOwners{}); err != nil { 420 return nil, err 421 } else { 422 return res.(*CarOwners), nil 423 } 424 } 425 426 func (c *FabCarServiceGateway) DeleteCarOwner(ctx context.Context, in *CarOwnerId) (*CarOwner, error) { 427 var inMsg interface{} = in 428 if v, ok := inMsg.(interface{ Validate() error }); ok { 429 if err := v.Validate(); err != nil { 430 return nil, err 431 } 432 } 433 434 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_DeleteCarOwner, []interface{}{in}, &CarOwner{}); err != nil { 435 return nil, err 436 } else { 437 return res.(*CarOwner), nil 438 } 439 } 440 441 func (c *FabCarServiceGateway) GetCarOwner(ctx context.Context, in *CarOwnerId) (*CarOwner, error) { 442 var inMsg interface{} = in 443 if v, ok := inMsg.(interface{ Validate() error }); ok { 444 if err := v.Validate(); err != nil { 445 return nil, err 446 } 447 } 448 449 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_GetCarOwner, []interface{}{in}, &CarOwner{}); err != nil { 450 return nil, err 451 } else { 452 return res.(*CarOwner), nil 453 } 454 } 455 456 func (c *FabCarServiceGateway) ListCarOwners(ctx context.Context, in *CarId) (*CarOwners, error) { 457 var inMsg interface{} = in 458 if v, ok := inMsg.(interface{ Validate() error }); ok { 459 if err := v.Validate(); err != nil { 460 return nil, err 461 } 462 } 463 464 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_ListCarOwners, []interface{}{in}, &CarOwners{}); err != nil { 465 return nil, err 466 } else { 467 return res.(*CarOwners), nil 468 } 469 } 470 471 func (c *FabCarServiceGateway) UpdateCarDetails(ctx context.Context, in *UpdateCarDetailsRequest) (*CarDetails, error) { 472 var inMsg interface{} = in 473 if v, ok := inMsg.(interface{ Validate() error }); ok { 474 if err := v.Validate(); err != nil { 475 return nil, err 476 } 477 } 478 479 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_UpdateCarDetails, []interface{}{in}, &CarDetails{}); err != nil { 480 return nil, err 481 } else { 482 return res.(*CarDetails), nil 483 } 484 } 485 486 func (c *FabCarServiceGateway) DeleteCarDetail(ctx context.Context, in *CarDetailId) (*CarDetail, error) { 487 var inMsg interface{} = in 488 if v, ok := inMsg.(interface{ Validate() error }); ok { 489 if err := v.Validate(); err != nil { 490 return nil, err 491 } 492 } 493 494 if res, err := c.Invoker().Invoke(ctx, FabCarServiceChaincode_DeleteCarDetail, []interface{}{in}, &CarDetail{}); err != nil { 495 return nil, err 496 } else { 497 return res.(*CarDetail), nil 498 } 499 } 500 501 func (c *FabCarServiceGateway) GetCarDetail(ctx context.Context, in *CarDetailId) (*CarDetail, error) { 502 var inMsg interface{} = in 503 if v, ok := inMsg.(interface{ Validate() error }); ok { 504 if err := v.Validate(); err != nil { 505 return nil, err 506 } 507 } 508 509 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_GetCarDetail, []interface{}{in}, &CarDetail{}); err != nil { 510 return nil, err 511 } else { 512 return res.(*CarDetail), nil 513 } 514 } 515 516 func (c *FabCarServiceGateway) ListCarDetails(ctx context.Context, in *CarId) (*CarDetails, error) { 517 var inMsg interface{} = in 518 if v, ok := inMsg.(interface{ Validate() error }); ok { 519 if err := v.Validate(); err != nil { 520 return nil, err 521 } 522 } 523 524 if res, err := c.Invoker().Query(ctx, FabCarServiceChaincode_ListCarDetails, []interface{}{in}, &CarDetails{}); err != nil { 525 return nil, err 526 } else { 527 return res.(*CarDetails), nil 528 } 529 } 530 531 // FabCarServiceChaincodeResolver interface for service resolver 532 type ( 533 FabCarServiceChaincodeResolver interface { 534 Resolve(ctx cckit_router.Context) (FabCarServiceChaincode, error) 535 } 536 537 FabCarServiceChaincodeLocalResolver struct { 538 service FabCarServiceChaincode 539 } 540 541 FabCarServiceChaincodeLocatorResolver struct { 542 locatorResolver cckit_gateway.ChaincodeLocatorResolver 543 service FabCarServiceChaincode 544 } 545 ) 546 547 func NewFabCarServiceChaincodeLocalResolver(service FabCarServiceChaincode) *FabCarServiceChaincodeLocalResolver { 548 return &FabCarServiceChaincodeLocalResolver{ 549 service: service, 550 } 551 } 552 553 func (r *FabCarServiceChaincodeLocalResolver) Resolve(ctx cckit_router.Context) (FabCarServiceChaincode, error) { 554 if r.service == nil { 555 return nil, errors.New("service not set for local chaincode resolver") 556 } 557 558 return r.service, nil 559 } 560 561 func NewFabCarServiceChaincodeResolver(locatorResolver cckit_gateway.ChaincodeLocatorResolver) *FabCarServiceChaincodeLocatorResolver { 562 return &FabCarServiceChaincodeLocatorResolver{ 563 locatorResolver: locatorResolver, 564 } 565 } 566 567 func (r *FabCarServiceChaincodeLocatorResolver) Resolve(ctx cckit_router.Context) (FabCarServiceChaincode, error) { 568 if r.service != nil { 569 return r.service, nil 570 } 571 572 locator, err := r.locatorResolver(ctx, _FabCarService_serviceDesc.ServiceName) 573 if err != nil { 574 return nil, err 575 } 576 577 r.service = NewFabCarServiceChaincodeStubInvoker(locator) 578 return r.service, nil 579 } 580 581 type FabCarServiceChaincodeStubInvoker struct { 582 Invoker cckit_gateway.ChaincodeStubInvoker 583 } 584 585 func NewFabCarServiceChaincodeStubInvoker(locator *cckit_gateway.ChaincodeLocator) *FabCarServiceChaincodeStubInvoker { 586 return &FabCarServiceChaincodeStubInvoker{ 587 Invoker: &cckit_gateway.LocatorChaincodeStubInvoker{Locator: locator}, 588 } 589 } 590 591 func (c *FabCarServiceChaincodeStubInvoker) CreateMaker(ctx cckit_router.Context, in *CreateMakerRequest) (*Maker, error) { 592 593 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 594 595 } 596 597 func (c *FabCarServiceChaincodeStubInvoker) DeleteMaker(ctx cckit_router.Context, in *MakerName) (*Maker, error) { 598 599 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 600 601 } 602 603 func (c *FabCarServiceChaincodeStubInvoker) GetMaker(ctx cckit_router.Context, in *MakerName) (*Maker, error) { 604 605 var inMsg interface{} = in 606 if v, ok := inMsg.(interface{ Validate() error }); ok { 607 if err := v.Validate(); err != nil { 608 return nil, err 609 } 610 } 611 612 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_GetMaker, []interface{}{in}, &Maker{}); err != nil { 613 return nil, err 614 } else { 615 return res.(*Maker), nil 616 } 617 618 } 619 620 func (c *FabCarServiceChaincodeStubInvoker) ListMakers(ctx cckit_router.Context, in *emptypb.Empty) (*Makers, error) { 621 622 var inMsg interface{} = in 623 if v, ok := inMsg.(interface{ Validate() error }); ok { 624 if err := v.Validate(); err != nil { 625 return nil, err 626 } 627 } 628 629 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_ListMakers, []interface{}{in}, &Makers{}); err != nil { 630 return nil, err 631 } else { 632 return res.(*Makers), nil 633 } 634 635 } 636 637 func (c *FabCarServiceChaincodeStubInvoker) CreateCar(ctx cckit_router.Context, in *CreateCarRequest) (*CarView, error) { 638 639 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 640 641 } 642 643 func (c *FabCarServiceChaincodeStubInvoker) UpdateCar(ctx cckit_router.Context, in *UpdateCarRequest) (*CarView, error) { 644 645 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 646 647 } 648 649 func (c *FabCarServiceChaincodeStubInvoker) DeleteCar(ctx cckit_router.Context, in *CarId) (*CarView, error) { 650 651 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 652 653 } 654 655 func (c *FabCarServiceChaincodeStubInvoker) GetCar(ctx cckit_router.Context, in *CarId) (*Car, error) { 656 657 var inMsg interface{} = in 658 if v, ok := inMsg.(interface{ Validate() error }); ok { 659 if err := v.Validate(); err != nil { 660 return nil, err 661 } 662 } 663 664 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_GetCar, []interface{}{in}, &Car{}); err != nil { 665 return nil, err 666 } else { 667 return res.(*Car), nil 668 } 669 670 } 671 672 func (c *FabCarServiceChaincodeStubInvoker) GetCarView(ctx cckit_router.Context, in *CarId) (*CarView, error) { 673 674 var inMsg interface{} = in 675 if v, ok := inMsg.(interface{ Validate() error }); ok { 676 if err := v.Validate(); err != nil { 677 return nil, err 678 } 679 } 680 681 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_GetCarView, []interface{}{in}, &CarView{}); err != nil { 682 return nil, err 683 } else { 684 return res.(*CarView), nil 685 } 686 687 } 688 689 func (c *FabCarServiceChaincodeStubInvoker) ListCars(ctx cckit_router.Context, in *emptypb.Empty) (*Cars, error) { 690 691 var inMsg interface{} = in 692 if v, ok := inMsg.(interface{ Validate() error }); ok { 693 if err := v.Validate(); err != nil { 694 return nil, err 695 } 696 } 697 698 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_ListCars, []interface{}{in}, &Cars{}); err != nil { 699 return nil, err 700 } else { 701 return res.(*Cars), nil 702 } 703 704 } 705 706 func (c *FabCarServiceChaincodeStubInvoker) UpdateCarOwners(ctx cckit_router.Context, in *UpdateCarOwnersRequest) (*CarOwners, error) { 707 708 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 709 710 } 711 712 func (c *FabCarServiceChaincodeStubInvoker) DeleteCarOwner(ctx cckit_router.Context, in *CarOwnerId) (*CarOwner, error) { 713 714 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 715 716 } 717 718 func (c *FabCarServiceChaincodeStubInvoker) GetCarOwner(ctx cckit_router.Context, in *CarOwnerId) (*CarOwner, error) { 719 720 var inMsg interface{} = in 721 if v, ok := inMsg.(interface{ Validate() error }); ok { 722 if err := v.Validate(); err != nil { 723 return nil, err 724 } 725 } 726 727 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_GetCarOwner, []interface{}{in}, &CarOwner{}); err != nil { 728 return nil, err 729 } else { 730 return res.(*CarOwner), nil 731 } 732 733 } 734 735 func (c *FabCarServiceChaincodeStubInvoker) ListCarOwners(ctx cckit_router.Context, in *CarId) (*CarOwners, error) { 736 737 var inMsg interface{} = in 738 if v, ok := inMsg.(interface{ Validate() error }); ok { 739 if err := v.Validate(); err != nil { 740 return nil, err 741 } 742 } 743 744 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_ListCarOwners, []interface{}{in}, &CarOwners{}); err != nil { 745 return nil, err 746 } else { 747 return res.(*CarOwners), nil 748 } 749 750 } 751 752 func (c *FabCarServiceChaincodeStubInvoker) UpdateCarDetails(ctx cckit_router.Context, in *UpdateCarDetailsRequest) (*CarDetails, error) { 753 754 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 755 756 } 757 758 func (c *FabCarServiceChaincodeStubInvoker) DeleteCarDetail(ctx cckit_router.Context, in *CarDetailId) (*CarDetail, error) { 759 760 return nil, cckit_gateway.ErrInvokeMethodNotAllowed 761 762 } 763 764 func (c *FabCarServiceChaincodeStubInvoker) GetCarDetail(ctx cckit_router.Context, in *CarDetailId) (*CarDetail, error) { 765 766 var inMsg interface{} = in 767 if v, ok := inMsg.(interface{ Validate() error }); ok { 768 if err := v.Validate(); err != nil { 769 return nil, err 770 } 771 } 772 773 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_GetCarDetail, []interface{}{in}, &CarDetail{}); err != nil { 774 return nil, err 775 } else { 776 return res.(*CarDetail), nil 777 } 778 779 } 780 781 func (c *FabCarServiceChaincodeStubInvoker) ListCarDetails(ctx cckit_router.Context, in *CarId) (*CarDetails, error) { 782 783 var inMsg interface{} = in 784 if v, ok := inMsg.(interface{ Validate() error }); ok { 785 if err := v.Validate(); err != nil { 786 return nil, err 787 } 788 } 789 790 if res, err := c.Invoker.Query(ctx.Stub(), FabCarServiceChaincode_ListCarDetails, []interface{}{in}, &CarDetails{}); err != nil { 791 return nil, err 792 } else { 793 return res.(*CarDetails), nil 794 } 795 796 }