github.com/argoproj/argo-cd@v1.8.7/pkg/apiclient/account/account.pb.gw.go (about) 1 // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. 2 // source: server/account/account.proto 3 4 /* 5 Package account is a reverse proxy. 6 7 It translates gRPC into RESTful JSON APIs. 8 */ 9 package account 10 11 import ( 12 "context" 13 "io" 14 "net/http" 15 16 "github.com/golang/protobuf/descriptor" 17 "github.com/golang/protobuf/proto" 18 "github.com/grpc-ecosystem/grpc-gateway/runtime" 19 "github.com/grpc-ecosystem/grpc-gateway/utilities" 20 "google.golang.org/grpc" 21 "google.golang.org/grpc/codes" 22 "google.golang.org/grpc/grpclog" 23 "google.golang.org/grpc/status" 24 ) 25 26 // Suppress "imported and not used" errors 27 var _ codes.Code 28 var _ io.Reader 29 var _ status.Status 30 var _ = runtime.String 31 var _ = utilities.NewDoubleArray 32 var _ = descriptor.ForMessage 33 34 func request_AccountService_CanI_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 35 var protoReq CanIRequest 36 var metadata runtime.ServerMetadata 37 38 var ( 39 val string 40 ok bool 41 err error 42 _ = err 43 ) 44 45 val, ok = pathParams["resource"] 46 if !ok { 47 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource") 48 } 49 50 protoReq.Resource, err = runtime.String(val) 51 52 if err != nil { 53 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err) 54 } 55 56 val, ok = pathParams["action"] 57 if !ok { 58 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "action") 59 } 60 61 protoReq.Action, err = runtime.String(val) 62 63 if err != nil { 64 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "action", err) 65 } 66 67 val, ok = pathParams["subresource"] 68 if !ok { 69 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subresource") 70 } 71 72 protoReq.Subresource, err = runtime.String(val) 73 74 if err != nil { 75 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subresource", err) 76 } 77 78 msg, err := client.CanI(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 79 return msg, metadata, err 80 81 } 82 83 func local_request_AccountService_CanI_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 84 var protoReq CanIRequest 85 var metadata runtime.ServerMetadata 86 87 var ( 88 val string 89 ok bool 90 err error 91 _ = err 92 ) 93 94 val, ok = pathParams["resource"] 95 if !ok { 96 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource") 97 } 98 99 protoReq.Resource, err = runtime.String(val) 100 101 if err != nil { 102 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource", err) 103 } 104 105 val, ok = pathParams["action"] 106 if !ok { 107 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "action") 108 } 109 110 protoReq.Action, err = runtime.String(val) 111 112 if err != nil { 113 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "action", err) 114 } 115 116 val, ok = pathParams["subresource"] 117 if !ok { 118 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subresource") 119 } 120 121 protoReq.Subresource, err = runtime.String(val) 122 123 if err != nil { 124 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subresource", err) 125 } 126 127 msg, err := server.CanI(ctx, &protoReq) 128 return msg, metadata, err 129 130 } 131 132 func request_AccountService_UpdatePassword_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 133 var protoReq UpdatePasswordRequest 134 var metadata runtime.ServerMetadata 135 136 newReader, berr := utilities.IOReaderFactory(req.Body) 137 if berr != nil { 138 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 139 } 140 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { 141 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 142 } 143 144 msg, err := client.UpdatePassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 145 return msg, metadata, err 146 147 } 148 149 func local_request_AccountService_UpdatePassword_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 150 var protoReq UpdatePasswordRequest 151 var metadata runtime.ServerMetadata 152 153 newReader, berr := utilities.IOReaderFactory(req.Body) 154 if berr != nil { 155 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 156 } 157 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { 158 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 159 } 160 161 msg, err := server.UpdatePassword(ctx, &protoReq) 162 return msg, metadata, err 163 164 } 165 166 func request_AccountService_ListAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 167 var protoReq ListAccountRequest 168 var metadata runtime.ServerMetadata 169 170 msg, err := client.ListAccounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 171 return msg, metadata, err 172 173 } 174 175 func local_request_AccountService_ListAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 176 var protoReq ListAccountRequest 177 var metadata runtime.ServerMetadata 178 179 msg, err := server.ListAccounts(ctx, &protoReq) 180 return msg, metadata, err 181 182 } 183 184 func request_AccountService_GetAccount_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 185 var protoReq GetAccountRequest 186 var metadata runtime.ServerMetadata 187 188 var ( 189 val string 190 ok bool 191 err error 192 _ = err 193 ) 194 195 val, ok = pathParams["name"] 196 if !ok { 197 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 198 } 199 200 protoReq.Name, err = runtime.String(val) 201 202 if err != nil { 203 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 204 } 205 206 msg, err := client.GetAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 207 return msg, metadata, err 208 209 } 210 211 func local_request_AccountService_GetAccount_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 212 var protoReq GetAccountRequest 213 var metadata runtime.ServerMetadata 214 215 var ( 216 val string 217 ok bool 218 err error 219 _ = err 220 ) 221 222 val, ok = pathParams["name"] 223 if !ok { 224 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 225 } 226 227 protoReq.Name, err = runtime.String(val) 228 229 if err != nil { 230 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 231 } 232 233 msg, err := server.GetAccount(ctx, &protoReq) 234 return msg, metadata, err 235 236 } 237 238 func request_AccountService_CreateToken_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 239 var protoReq CreateTokenRequest 240 var metadata runtime.ServerMetadata 241 242 newReader, berr := utilities.IOReaderFactory(req.Body) 243 if berr != nil { 244 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 245 } 246 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { 247 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 248 } 249 250 var ( 251 val string 252 ok bool 253 err error 254 _ = err 255 ) 256 257 val, ok = pathParams["name"] 258 if !ok { 259 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 260 } 261 262 protoReq.Name, err = runtime.String(val) 263 264 if err != nil { 265 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 266 } 267 268 msg, err := client.CreateToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 269 return msg, metadata, err 270 271 } 272 273 func local_request_AccountService_CreateToken_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 274 var protoReq CreateTokenRequest 275 var metadata runtime.ServerMetadata 276 277 newReader, berr := utilities.IOReaderFactory(req.Body) 278 if berr != nil { 279 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) 280 } 281 if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { 282 return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) 283 } 284 285 var ( 286 val string 287 ok bool 288 err error 289 _ = err 290 ) 291 292 val, ok = pathParams["name"] 293 if !ok { 294 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 295 } 296 297 protoReq.Name, err = runtime.String(val) 298 299 if err != nil { 300 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 301 } 302 303 msg, err := server.CreateToken(ctx, &protoReq) 304 return msg, metadata, err 305 306 } 307 308 func request_AccountService_DeleteToken_0(ctx context.Context, marshaler runtime.Marshaler, client AccountServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 309 var protoReq DeleteTokenRequest 310 var metadata runtime.ServerMetadata 311 312 var ( 313 val string 314 ok bool 315 err error 316 _ = err 317 ) 318 319 val, ok = pathParams["name"] 320 if !ok { 321 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 322 } 323 324 protoReq.Name, err = runtime.String(val) 325 326 if err != nil { 327 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 328 } 329 330 val, ok = pathParams["id"] 331 if !ok { 332 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 333 } 334 335 protoReq.Id, err = runtime.String(val) 336 337 if err != nil { 338 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 339 } 340 341 msg, err := client.DeleteToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) 342 return msg, metadata, err 343 344 } 345 346 func local_request_AccountService_DeleteToken_0(ctx context.Context, marshaler runtime.Marshaler, server AccountServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { 347 var protoReq DeleteTokenRequest 348 var metadata runtime.ServerMetadata 349 350 var ( 351 val string 352 ok bool 353 err error 354 _ = err 355 ) 356 357 val, ok = pathParams["name"] 358 if !ok { 359 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") 360 } 361 362 protoReq.Name, err = runtime.String(val) 363 364 if err != nil { 365 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) 366 } 367 368 val, ok = pathParams["id"] 369 if !ok { 370 return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") 371 } 372 373 protoReq.Id, err = runtime.String(val) 374 375 if err != nil { 376 return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) 377 } 378 379 msg, err := server.DeleteToken(ctx, &protoReq) 380 return msg, metadata, err 381 382 } 383 384 // RegisterAccountServiceHandlerServer registers the http handlers for service AccountService to "mux". 385 // UnaryRPC :call AccountServiceServer directly. 386 // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. 387 func RegisterAccountServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServiceServer) error { 388 389 mux.Handle("GET", pattern_AccountService_CanI_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 390 ctx, cancel := context.WithCancel(req.Context()) 391 defer cancel() 392 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 393 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 394 if err != nil { 395 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 396 return 397 } 398 resp, md, err := local_request_AccountService_CanI_0(rctx, inboundMarshaler, server, req, pathParams) 399 ctx = runtime.NewServerMetadataContext(ctx, md) 400 if err != nil { 401 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 402 return 403 } 404 405 forward_AccountService_CanI_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 406 407 }) 408 409 mux.Handle("PUT", pattern_AccountService_UpdatePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 410 ctx, cancel := context.WithCancel(req.Context()) 411 defer cancel() 412 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 413 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 414 if err != nil { 415 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 416 return 417 } 418 resp, md, err := local_request_AccountService_UpdatePassword_0(rctx, inboundMarshaler, server, req, pathParams) 419 ctx = runtime.NewServerMetadataContext(ctx, md) 420 if err != nil { 421 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 422 return 423 } 424 425 forward_AccountService_UpdatePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 426 427 }) 428 429 mux.Handle("GET", pattern_AccountService_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 430 ctx, cancel := context.WithCancel(req.Context()) 431 defer cancel() 432 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 433 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 434 if err != nil { 435 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 436 return 437 } 438 resp, md, err := local_request_AccountService_ListAccounts_0(rctx, inboundMarshaler, server, req, pathParams) 439 ctx = runtime.NewServerMetadataContext(ctx, md) 440 if err != nil { 441 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 442 return 443 } 444 445 forward_AccountService_ListAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 446 447 }) 448 449 mux.Handle("GET", pattern_AccountService_GetAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 450 ctx, cancel := context.WithCancel(req.Context()) 451 defer cancel() 452 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 453 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 454 if err != nil { 455 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 456 return 457 } 458 resp, md, err := local_request_AccountService_GetAccount_0(rctx, inboundMarshaler, server, req, pathParams) 459 ctx = runtime.NewServerMetadataContext(ctx, md) 460 if err != nil { 461 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 462 return 463 } 464 465 forward_AccountService_GetAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 466 467 }) 468 469 mux.Handle("POST", pattern_AccountService_CreateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 470 ctx, cancel := context.WithCancel(req.Context()) 471 defer cancel() 472 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 473 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 474 if err != nil { 475 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 476 return 477 } 478 resp, md, err := local_request_AccountService_CreateToken_0(rctx, inboundMarshaler, server, req, pathParams) 479 ctx = runtime.NewServerMetadataContext(ctx, md) 480 if err != nil { 481 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 482 return 483 } 484 485 forward_AccountService_CreateToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 486 487 }) 488 489 mux.Handle("DELETE", pattern_AccountService_DeleteToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 490 ctx, cancel := context.WithCancel(req.Context()) 491 defer cancel() 492 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 493 rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) 494 if err != nil { 495 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 496 return 497 } 498 resp, md, err := local_request_AccountService_DeleteToken_0(rctx, inboundMarshaler, server, req, pathParams) 499 ctx = runtime.NewServerMetadataContext(ctx, md) 500 if err != nil { 501 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 502 return 503 } 504 505 forward_AccountService_DeleteToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 506 507 }) 508 509 return nil 510 } 511 512 // RegisterAccountServiceHandlerFromEndpoint is same as RegisterAccountServiceHandler but 513 // automatically dials to "endpoint" and closes the connection when "ctx" gets done. 514 func RegisterAccountServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { 515 conn, err := grpc.Dial(endpoint, opts...) 516 if err != nil { 517 return err 518 } 519 defer func() { 520 if err != nil { 521 if cerr := conn.Close(); cerr != nil { 522 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 523 } 524 return 525 } 526 go func() { 527 <-ctx.Done() 528 if cerr := conn.Close(); cerr != nil { 529 grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) 530 } 531 }() 532 }() 533 534 return RegisterAccountServiceHandler(ctx, mux, conn) 535 } 536 537 // RegisterAccountServiceHandler registers the http handlers for service AccountService to "mux". 538 // The handlers forward requests to the grpc endpoint over "conn". 539 func RegisterAccountServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { 540 return RegisterAccountServiceHandlerClient(ctx, mux, NewAccountServiceClient(conn)) 541 } 542 543 // RegisterAccountServiceHandlerClient registers the http handlers for service AccountService 544 // to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccountServiceClient". 545 // Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccountServiceClient" 546 // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in 547 // "AccountServiceClient" to call the correct interceptors. 548 func RegisterAccountServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountServiceClient) error { 549 550 mux.Handle("GET", pattern_AccountService_CanI_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 551 ctx, cancel := context.WithCancel(req.Context()) 552 defer cancel() 553 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 554 rctx, err := runtime.AnnotateContext(ctx, mux, req) 555 if err != nil { 556 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 557 return 558 } 559 resp, md, err := request_AccountService_CanI_0(rctx, inboundMarshaler, client, req, pathParams) 560 ctx = runtime.NewServerMetadataContext(ctx, md) 561 if err != nil { 562 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 563 return 564 } 565 566 forward_AccountService_CanI_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 567 568 }) 569 570 mux.Handle("PUT", pattern_AccountService_UpdatePassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 571 ctx, cancel := context.WithCancel(req.Context()) 572 defer cancel() 573 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 574 rctx, err := runtime.AnnotateContext(ctx, mux, req) 575 if err != nil { 576 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 577 return 578 } 579 resp, md, err := request_AccountService_UpdatePassword_0(rctx, inboundMarshaler, client, req, pathParams) 580 ctx = runtime.NewServerMetadataContext(ctx, md) 581 if err != nil { 582 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 583 return 584 } 585 586 forward_AccountService_UpdatePassword_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 587 588 }) 589 590 mux.Handle("GET", pattern_AccountService_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 591 ctx, cancel := context.WithCancel(req.Context()) 592 defer cancel() 593 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 594 rctx, err := runtime.AnnotateContext(ctx, mux, req) 595 if err != nil { 596 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 597 return 598 } 599 resp, md, err := request_AccountService_ListAccounts_0(rctx, inboundMarshaler, client, req, pathParams) 600 ctx = runtime.NewServerMetadataContext(ctx, md) 601 if err != nil { 602 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 603 return 604 } 605 606 forward_AccountService_ListAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 607 608 }) 609 610 mux.Handle("GET", pattern_AccountService_GetAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 611 ctx, cancel := context.WithCancel(req.Context()) 612 defer cancel() 613 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 614 rctx, err := runtime.AnnotateContext(ctx, mux, req) 615 if err != nil { 616 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 617 return 618 } 619 resp, md, err := request_AccountService_GetAccount_0(rctx, inboundMarshaler, client, req, pathParams) 620 ctx = runtime.NewServerMetadataContext(ctx, md) 621 if err != nil { 622 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 623 return 624 } 625 626 forward_AccountService_GetAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 627 628 }) 629 630 mux.Handle("POST", pattern_AccountService_CreateToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 631 ctx, cancel := context.WithCancel(req.Context()) 632 defer cancel() 633 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 634 rctx, err := runtime.AnnotateContext(ctx, mux, req) 635 if err != nil { 636 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 637 return 638 } 639 resp, md, err := request_AccountService_CreateToken_0(rctx, inboundMarshaler, client, req, pathParams) 640 ctx = runtime.NewServerMetadataContext(ctx, md) 641 if err != nil { 642 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 643 return 644 } 645 646 forward_AccountService_CreateToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 647 648 }) 649 650 mux.Handle("DELETE", pattern_AccountService_DeleteToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { 651 ctx, cancel := context.WithCancel(req.Context()) 652 defer cancel() 653 inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) 654 rctx, err := runtime.AnnotateContext(ctx, mux, req) 655 if err != nil { 656 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 657 return 658 } 659 resp, md, err := request_AccountService_DeleteToken_0(rctx, inboundMarshaler, client, req, pathParams) 660 ctx = runtime.NewServerMetadataContext(ctx, md) 661 if err != nil { 662 runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) 663 return 664 } 665 666 forward_AccountService_DeleteToken_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) 667 668 }) 669 670 return nil 671 } 672 673 var ( 674 pattern_AccountService_CanI_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"api", "v1", "account", "can-i", "resource", "action", "subresource"}, "", runtime.AssumeColonVerbOpt(true))) 675 676 pattern_AccountService_UpdatePassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "account", "password"}, "", runtime.AssumeColonVerbOpt(true))) 677 678 pattern_AccountService_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v1", "account"}, "", runtime.AssumeColonVerbOpt(true))) 679 680 pattern_AccountService_GetAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v1", "account", "name"}, "", runtime.AssumeColonVerbOpt(true))) 681 682 pattern_AccountService_CreateToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v1", "account", "name", "token"}, "", runtime.AssumeColonVerbOpt(true))) 683 684 pattern_AccountService_DeleteToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v1", "account", "name", "token", "id"}, "", runtime.AssumeColonVerbOpt(true))) 685 ) 686 687 var ( 688 forward_AccountService_CanI_0 = runtime.ForwardResponseMessage 689 690 forward_AccountService_UpdatePassword_0 = runtime.ForwardResponseMessage 691 692 forward_AccountService_ListAccounts_0 = runtime.ForwardResponseMessage 693 694 forward_AccountService_GetAccount_0 = runtime.ForwardResponseMessage 695 696 forward_AccountService_CreateToken_0 = runtime.ForwardResponseMessage 697 698 forward_AccountService_DeleteToken_0 = runtime.ForwardResponseMessage 699 )