OLD | NEW |
1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 // Package config provides access to the Configuration Service. | 5 // Package config provides access to the Configuration Service. |
6 // | 6 // |
7 // Usage example: | 7 // Usage example: |
8 // | 8 // |
9 // import "github.com/luci/luci-go/common/api/luci_config/config/v1" | 9 // import "github.com/luci/luci-go/common/api/luci_config/config/v1" |
10 // ... | 10 // ... |
11 // configService, err := config.New(oauthHttpClient) | 11 // configService, err := config.New(oauthHttpClient) |
12 package config // import "github.com/luci/luci-go/common/api/luci_config/config/
v1" | 12 package config // import "github.com/luci/luci-go/common/api/luci_config/config/
v1" |
13 | 13 |
14 import ( | 14 import ( |
15 "bytes" | 15 "bytes" |
16 "encoding/json" | 16 "encoding/json" |
17 "errors" | 17 "errors" |
18 "fmt" | 18 "fmt" |
| 19 context "golang.org/x/net/context" |
| 20 ctxhttp "golang.org/x/net/context/ctxhttp" |
| 21 gensupport "google.golang.org/api/gensupport" |
| 22 googleapi "google.golang.org/api/googleapi" |
19 "io" | 23 "io" |
20 "net/http" | 24 "net/http" |
21 "net/url" | 25 "net/url" |
22 "strconv" | 26 "strconv" |
23 "strings" | 27 "strings" |
24 | |
25 context "golang.org/x/net/context" | |
26 ctxhttp "golang.org/x/net/context/ctxhttp" | |
27 gensupport "google.golang.org/api/gensupport" | |
28 googleapi "google.golang.org/api/googleapi" | |
29 ) | 28 ) |
30 | 29 |
31 // Always reference these packages, just in case the auto-generated code | 30 // Always reference these packages, just in case the auto-generated code |
32 // below doesn't. | 31 // below doesn't. |
33 var _ = bytes.NewBuffer | 32 var _ = bytes.NewBuffer |
34 var _ = strconv.Itoa | 33 var _ = strconv.Itoa |
35 var _ = fmt.Sprintf | 34 var _ = fmt.Sprintf |
36 var _ = json.NewDecoder | 35 var _ = json.NewDecoder |
37 var _ = io.Copy | 36 var _ = io.Copy |
38 var _ = url.Parse | 37 var _ = url.Parse |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 | 475 |
477 // Context sets the context to be used in this call's Do method. Any | 476 // Context sets the context to be used in this call's Do method. Any |
478 // pending HTTP request will be aborted if the provided context is | 477 // pending HTTP request will be aborted if the provided context is |
479 // canceled. | 478 // canceled. |
480 func (c *GetConfigCall) Context(ctx context.Context) *GetConfigCall { | 479 func (c *GetConfigCall) Context(ctx context.Context) *GetConfigCall { |
481 c.ctx_ = ctx | 480 c.ctx_ = ctx |
482 return c | 481 return c |
483 } | 482 } |
484 | 483 |
485 func (c *GetConfigCall) doRequest(alt string) (*http.Response, error) { | 484 func (c *GetConfigCall) doRequest(alt string) (*http.Response, error) { |
486 reqHeaders := make(http.Header) | |
487 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
488 if c.ifNoneMatch_ != "" { | |
489 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
490 } | |
491 var body io.Reader = nil | 485 var body io.Reader = nil |
492 c.urlParams_.Set("alt", alt) | 486 c.urlParams_.Set("alt", alt) |
493 urls := googleapi.ResolveRelative(c.s.BasePath, "config_sets/{config_set
}/config/{path}") | 487 urls := googleapi.ResolveRelative(c.s.BasePath, "config_sets/{config_set
}/config/{path}") |
494 urls += "?" + c.urlParams_.Encode() | 488 urls += "?" + c.urlParams_.Encode() |
495 req, _ := http.NewRequest("GET", urls, body) | 489 req, _ := http.NewRequest("GET", urls, body) |
496 req.Header = reqHeaders | |
497 googleapi.Expand(req.URL, map[string]string{ | 490 googleapi.Expand(req.URL, map[string]string{ |
498 "config_set": c.configSet, | 491 "config_set": c.configSet, |
499 "path": c.path, | 492 "path": c.path, |
500 }) | 493 }) |
501 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 494 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 495 » if c.ifNoneMatch_ != "" { |
| 496 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 497 » } |
| 498 » if c.ctx_ != nil { |
| 499 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 500 » } |
| 501 » return c.s.client.Do(req) |
502 } | 502 } |
503 | 503 |
504 // Do executes the "config.get_config" call. | 504 // Do executes the "config.get_config" call. |
505 // Exactly one of *LuciConfigGetConfigResponseMessage or error will be | 505 // Exactly one of *LuciConfigGetConfigResponseMessage or error will be |
506 // non-nil. Any non-2xx status code is an error. Response headers are in | 506 // non-nil. Any non-2xx status code is an error. Response headers are in |
507 // either *LuciConfigGetConfigResponseMessage.ServerResponse.Header or | 507 // either *LuciConfigGetConfigResponseMessage.ServerResponse.Header or |
508 // (if a response was returned at all) in | 508 // (if a response was returned at all) in |
509 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | 509 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
510 // whether the returned error was because http.StatusNotModified was | 510 // whether the returned error was because http.StatusNotModified was |
511 // returned. | 511 // returned. |
(...skipping 15 matching lines...) Expand all Loading... |
527 defer googleapi.CloseBody(res) | 527 defer googleapi.CloseBody(res) |
528 if err := googleapi.CheckResponse(res); err != nil { | 528 if err := googleapi.CheckResponse(res); err != nil { |
529 return nil, err | 529 return nil, err |
530 } | 530 } |
531 ret := &LuciConfigGetConfigResponseMessage{ | 531 ret := &LuciConfigGetConfigResponseMessage{ |
532 ServerResponse: googleapi.ServerResponse{ | 532 ServerResponse: googleapi.ServerResponse{ |
533 Header: res.Header, | 533 Header: res.Header, |
534 HTTPStatusCode: res.StatusCode, | 534 HTTPStatusCode: res.StatusCode, |
535 }, | 535 }, |
536 } | 536 } |
537 » target := &ret | 537 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
538 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
539 return nil, err | 538 return nil, err |
540 } | 539 } |
541 return ret, nil | 540 return ret, nil |
542 // { | 541 // { |
543 // "description": "Gets a config file.", | 542 // "description": "Gets a config file.", |
544 // "httpMethod": "GET", | 543 // "httpMethod": "GET", |
545 // "id": "config.get_config", | 544 // "id": "config.get_config", |
546 // "parameterOrder": [ | 545 // "parameterOrder": [ |
547 // "config_set", | 546 // "config_set", |
548 // "path" | 547 // "path" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 | 614 |
616 // Context sets the context to be used in this call's Do method. Any | 615 // Context sets the context to be used in this call's Do method. Any |
617 // pending HTTP request will be aborted if the provided context is | 616 // pending HTTP request will be aborted if the provided context is |
618 // canceled. | 617 // canceled. |
619 func (c *GetConfigByHashCall) Context(ctx context.Context) *GetConfigByHashCall
{ | 618 func (c *GetConfigByHashCall) Context(ctx context.Context) *GetConfigByHashCall
{ |
620 c.ctx_ = ctx | 619 c.ctx_ = ctx |
621 return c | 620 return c |
622 } | 621 } |
623 | 622 |
624 func (c *GetConfigByHashCall) doRequest(alt string) (*http.Response, error) { | 623 func (c *GetConfigByHashCall) doRequest(alt string) (*http.Response, error) { |
625 reqHeaders := make(http.Header) | |
626 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
627 if c.ifNoneMatch_ != "" { | |
628 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
629 } | |
630 var body io.Reader = nil | 624 var body io.Reader = nil |
631 c.urlParams_.Set("alt", alt) | 625 c.urlParams_.Set("alt", alt) |
632 urls := googleapi.ResolveRelative(c.s.BasePath, "config/{content_hash}") | 626 urls := googleapi.ResolveRelative(c.s.BasePath, "config/{content_hash}") |
633 urls += "?" + c.urlParams_.Encode() | 627 urls += "?" + c.urlParams_.Encode() |
634 req, _ := http.NewRequest("GET", urls, body) | 628 req, _ := http.NewRequest("GET", urls, body) |
635 req.Header = reqHeaders | |
636 googleapi.Expand(req.URL, map[string]string{ | 629 googleapi.Expand(req.URL, map[string]string{ |
637 "content_hash": c.contentHash, | 630 "content_hash": c.contentHash, |
638 }) | 631 }) |
639 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 632 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 633 » if c.ifNoneMatch_ != "" { |
| 634 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 635 » } |
| 636 » if c.ctx_ != nil { |
| 637 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 638 » } |
| 639 » return c.s.client.Do(req) |
640 } | 640 } |
641 | 641 |
642 // Do executes the "config.get_config_by_hash" call. | 642 // Do executes the "config.get_config_by_hash" call. |
643 // Exactly one of *LuciConfigGetConfigByHashResponseMessage or error | 643 // Exactly one of *LuciConfigGetConfigByHashResponseMessage or error |
644 // will be non-nil. Any non-2xx status code is an error. Response | 644 // will be non-nil. Any non-2xx status code is an error. Response |
645 // headers are in either | 645 // headers are in either |
646 // *LuciConfigGetConfigByHashResponseMessage.ServerResponse.Header or | 646 // *LuciConfigGetConfigByHashResponseMessage.ServerResponse.Header or |
647 // (if a response was returned at all) in | 647 // (if a response was returned at all) in |
648 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | 648 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
649 // whether the returned error was because http.StatusNotModified was | 649 // whether the returned error was because http.StatusNotModified was |
(...skipping 16 matching lines...) Expand all Loading... |
666 defer googleapi.CloseBody(res) | 666 defer googleapi.CloseBody(res) |
667 if err := googleapi.CheckResponse(res); err != nil { | 667 if err := googleapi.CheckResponse(res); err != nil { |
668 return nil, err | 668 return nil, err |
669 } | 669 } |
670 ret := &LuciConfigGetConfigByHashResponseMessage{ | 670 ret := &LuciConfigGetConfigByHashResponseMessage{ |
671 ServerResponse: googleapi.ServerResponse{ | 671 ServerResponse: googleapi.ServerResponse{ |
672 Header: res.Header, | 672 Header: res.Header, |
673 HTTPStatusCode: res.StatusCode, | 673 HTTPStatusCode: res.StatusCode, |
674 }, | 674 }, |
675 } | 675 } |
676 » target := &ret | 676 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
677 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
678 return nil, err | 677 return nil, err |
679 } | 678 } |
680 return ret, nil | 679 return ret, nil |
681 // { | 680 // { |
682 // "description": "Gets a config file by its hash.", | 681 // "description": "Gets a config file by its hash.", |
683 // "httpMethod": "GET", | 682 // "httpMethod": "GET", |
684 // "id": "config.get_config_by_hash", | 683 // "id": "config.get_config_by_hash", |
685 // "parameterOrder": [ | 684 // "parameterOrder": [ |
686 // "content_hash" | 685 // "content_hash" |
687 // ], | 686 // ], |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 | 750 |
752 // Context sets the context to be used in this call's Do method. Any | 751 // Context sets the context to be used in this call's Do method. Any |
753 // pending HTTP request will be aborted if the provided context is | 752 // pending HTTP request will be aborted if the provided context is |
754 // canceled. | 753 // canceled. |
755 func (c *GetConfigSetsCall) Context(ctx context.Context) *GetConfigSetsCall { | 754 func (c *GetConfigSetsCall) Context(ctx context.Context) *GetConfigSetsCall { |
756 c.ctx_ = ctx | 755 c.ctx_ = ctx |
757 return c | 756 return c |
758 } | 757 } |
759 | 758 |
760 func (c *GetConfigSetsCall) doRequest(alt string) (*http.Response, error) { | 759 func (c *GetConfigSetsCall) doRequest(alt string) (*http.Response, error) { |
761 reqHeaders := make(http.Header) | |
762 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
763 if c.ifNoneMatch_ != "" { | |
764 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
765 } | |
766 var body io.Reader = nil | 760 var body io.Reader = nil |
767 c.urlParams_.Set("alt", alt) | 761 c.urlParams_.Set("alt", alt) |
768 urls := googleapi.ResolveRelative(c.s.BasePath, "config-sets") | 762 urls := googleapi.ResolveRelative(c.s.BasePath, "config-sets") |
769 urls += "?" + c.urlParams_.Encode() | 763 urls += "?" + c.urlParams_.Encode() |
770 req, _ := http.NewRequest("GET", urls, body) | 764 req, _ := http.NewRequest("GET", urls, body) |
771 req.Header = reqHeaders | |
772 googleapi.SetOpaque(req.URL) | 765 googleapi.SetOpaque(req.URL) |
773 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 766 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 767 » if c.ifNoneMatch_ != "" { |
| 768 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 769 » } |
| 770 » if c.ctx_ != nil { |
| 771 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 772 » } |
| 773 » return c.s.client.Do(req) |
774 } | 774 } |
775 | 775 |
776 // Do executes the "config.get_config_sets" call. | 776 // Do executes the "config.get_config_sets" call. |
777 // Exactly one of *LuciConfigGetConfigSetsResponseMessage or error will | 777 // Exactly one of *LuciConfigGetConfigSetsResponseMessage or error will |
778 // be non-nil. Any non-2xx status code is an error. Response headers are | 778 // be non-nil. Any non-2xx status code is an error. Response headers are |
779 // in either | 779 // in either |
780 // *LuciConfigGetConfigSetsResponseMessage.ServerResponse.Header or (if | 780 // *LuciConfigGetConfigSetsResponseMessage.ServerResponse.Header or (if |
781 // a response was returned at all) in error.(*googleapi.Error).Header. | 781 // a response was returned at all) in error.(*googleapi.Error).Header. |
782 // Use googleapi.IsNotModified to check whether the returned error was | 782 // Use googleapi.IsNotModified to check whether the returned error was |
783 // because http.StatusNotModified was returned. | 783 // because http.StatusNotModified was returned. |
(...skipping 15 matching lines...) Expand all Loading... |
799 defer googleapi.CloseBody(res) | 799 defer googleapi.CloseBody(res) |
800 if err := googleapi.CheckResponse(res); err != nil { | 800 if err := googleapi.CheckResponse(res); err != nil { |
801 return nil, err | 801 return nil, err |
802 } | 802 } |
803 ret := &LuciConfigGetConfigSetsResponseMessage{ | 803 ret := &LuciConfigGetConfigSetsResponseMessage{ |
804 ServerResponse: googleapi.ServerResponse{ | 804 ServerResponse: googleapi.ServerResponse{ |
805 Header: res.Header, | 805 Header: res.Header, |
806 HTTPStatusCode: res.StatusCode, | 806 HTTPStatusCode: res.StatusCode, |
807 }, | 807 }, |
808 } | 808 } |
809 » target := &ret | 809 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
810 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
811 return nil, err | 810 return nil, err |
812 } | 811 } |
813 return ret, nil | 812 return ret, nil |
814 // { | 813 // { |
815 // "description": "Returns config sets.", | 814 // "description": "Returns config sets.", |
816 // "httpMethod": "GET", | 815 // "httpMethod": "GET", |
817 // "id": "config.get_config_sets", | 816 // "id": "config.get_config_sets", |
818 // "parameters": { | 817 // "parameters": { |
819 // "config_set": { | 818 // "config_set": { |
820 // "location": "query", | 819 // "location": "query", |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 | 876 |
878 // Context sets the context to be used in this call's Do method. Any | 877 // Context sets the context to be used in this call's Do method. Any |
879 // pending HTTP request will be aborted if the provided context is | 878 // pending HTTP request will be aborted if the provided context is |
880 // canceled. | 879 // canceled. |
881 func (c *GetMappingCall) Context(ctx context.Context) *GetMappingCall { | 880 func (c *GetMappingCall) Context(ctx context.Context) *GetMappingCall { |
882 c.ctx_ = ctx | 881 c.ctx_ = ctx |
883 return c | 882 return c |
884 } | 883 } |
885 | 884 |
886 func (c *GetMappingCall) doRequest(alt string) (*http.Response, error) { | 885 func (c *GetMappingCall) doRequest(alt string) (*http.Response, error) { |
887 reqHeaders := make(http.Header) | |
888 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
889 if c.ifNoneMatch_ != "" { | |
890 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
891 } | |
892 var body io.Reader = nil | 886 var body io.Reader = nil |
893 c.urlParams_.Set("alt", alt) | 887 c.urlParams_.Set("alt", alt) |
894 urls := googleapi.ResolveRelative(c.s.BasePath, "mapping") | 888 urls := googleapi.ResolveRelative(c.s.BasePath, "mapping") |
895 urls += "?" + c.urlParams_.Encode() | 889 urls += "?" + c.urlParams_.Encode() |
896 req, _ := http.NewRequest("GET", urls, body) | 890 req, _ := http.NewRequest("GET", urls, body) |
897 req.Header = reqHeaders | |
898 googleapi.SetOpaque(req.URL) | 891 googleapi.SetOpaque(req.URL) |
899 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 892 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 893 » if c.ifNoneMatch_ != "" { |
| 894 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 895 » } |
| 896 » if c.ctx_ != nil { |
| 897 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 898 » } |
| 899 » return c.s.client.Do(req) |
900 } | 900 } |
901 | 901 |
902 // Do executes the "config.get_mapping" call. | 902 // Do executes the "config.get_mapping" call. |
903 // Exactly one of *LuciConfigGetMappingResponseMessage or error will be | 903 // Exactly one of *LuciConfigGetMappingResponseMessage or error will be |
904 // non-nil. Any non-2xx status code is an error. Response headers are in | 904 // non-nil. Any non-2xx status code is an error. Response headers are in |
905 // either *LuciConfigGetMappingResponseMessage.ServerResponse.Header or | 905 // either *LuciConfigGetMappingResponseMessage.ServerResponse.Header or |
906 // (if a response was returned at all) in | 906 // (if a response was returned at all) in |
907 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | 907 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
908 // whether the returned error was because http.StatusNotModified was | 908 // whether the returned error was because http.StatusNotModified was |
909 // returned. | 909 // returned. |
(...skipping 15 matching lines...) Expand all Loading... |
925 defer googleapi.CloseBody(res) | 925 defer googleapi.CloseBody(res) |
926 if err := googleapi.CheckResponse(res); err != nil { | 926 if err := googleapi.CheckResponse(res); err != nil { |
927 return nil, err | 927 return nil, err |
928 } | 928 } |
929 ret := &LuciConfigGetMappingResponseMessage{ | 929 ret := &LuciConfigGetMappingResponseMessage{ |
930 ServerResponse: googleapi.ServerResponse{ | 930 ServerResponse: googleapi.ServerResponse{ |
931 Header: res.Header, | 931 Header: res.Header, |
932 HTTPStatusCode: res.StatusCode, | 932 HTTPStatusCode: res.StatusCode, |
933 }, | 933 }, |
934 } | 934 } |
935 » target := &ret | 935 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
936 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
937 return nil, err | 936 return nil, err |
938 } | 937 } |
939 return ret, nil | 938 return ret, nil |
940 // { | 939 // { |
941 // "description": "DEPRECATED. Use get_config_sets.", | 940 // "description": "DEPRECATED. Use get_config_sets.", |
942 // "httpMethod": "GET", | 941 // "httpMethod": "GET", |
943 // "id": "config.get_mapping", | 942 // "id": "config.get_mapping", |
944 // "parameters": { | 943 // "parameters": { |
945 // "config_set": { | 944 // "config_set": { |
946 // "location": "query", | 945 // "location": "query", |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 | 1000 |
1002 // Context sets the context to be used in this call's Do method. Any | 1001 // Context sets the context to be used in this call's Do method. Any |
1003 // pending HTTP request will be aborted if the provided context is | 1002 // pending HTTP request will be aborted if the provided context is |
1004 // canceled. | 1003 // canceled. |
1005 func (c *GetProjectConfigsCall) Context(ctx context.Context) *GetProjectConfigsC
all { | 1004 func (c *GetProjectConfigsCall) Context(ctx context.Context) *GetProjectConfigsC
all { |
1006 c.ctx_ = ctx | 1005 c.ctx_ = ctx |
1007 return c | 1006 return c |
1008 } | 1007 } |
1009 | 1008 |
1010 func (c *GetProjectConfigsCall) doRequest(alt string) (*http.Response, error) { | 1009 func (c *GetProjectConfigsCall) doRequest(alt string) (*http.Response, error) { |
1011 reqHeaders := make(http.Header) | |
1012 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
1013 if c.ifNoneMatch_ != "" { | |
1014 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
1015 } | |
1016 var body io.Reader = nil | 1010 var body io.Reader = nil |
1017 c.urlParams_.Set("alt", alt) | 1011 c.urlParams_.Set("alt", alt) |
1018 urls := googleapi.ResolveRelative(c.s.BasePath, "configs/projects/{path}
") | 1012 urls := googleapi.ResolveRelative(c.s.BasePath, "configs/projects/{path}
") |
1019 urls += "?" + c.urlParams_.Encode() | 1013 urls += "?" + c.urlParams_.Encode() |
1020 req, _ := http.NewRequest("GET", urls, body) | 1014 req, _ := http.NewRequest("GET", urls, body) |
1021 req.Header = reqHeaders | |
1022 googleapi.Expand(req.URL, map[string]string{ | 1015 googleapi.Expand(req.URL, map[string]string{ |
1023 "path": c.path, | 1016 "path": c.path, |
1024 }) | 1017 }) |
1025 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 1018 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 1019 » if c.ifNoneMatch_ != "" { |
| 1020 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 1021 » } |
| 1022 » if c.ctx_ != nil { |
| 1023 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 1024 » } |
| 1025 » return c.s.client.Do(req) |
1026 } | 1026 } |
1027 | 1027 |
1028 // Do executes the "config.get_project_configs" call. | 1028 // Do executes the "config.get_project_configs" call. |
1029 // Exactly one of *LuciConfigGetConfigMultiResponseMessage or error will | 1029 // Exactly one of *LuciConfigGetConfigMultiResponseMessage or error will |
1030 // be non-nil. Any non-2xx status code is an error. Response headers are | 1030 // be non-nil. Any non-2xx status code is an error. Response headers are |
1031 // in either | 1031 // in either |
1032 // *LuciConfigGetConfigMultiResponseMessage.ServerResponse.Header or (if | 1032 // *LuciConfigGetConfigMultiResponseMessage.ServerResponse.Header or (if |
1033 // a response was returned at all) in error.(*googleapi.Error).Header. | 1033 // a response was returned at all) in error.(*googleapi.Error).Header. |
1034 // Use googleapi.IsNotModified to check whether the returned error was | 1034 // Use googleapi.IsNotModified to check whether the returned error was |
1035 // because http.StatusNotModified was returned. | 1035 // because http.StatusNotModified was returned. |
(...skipping 15 matching lines...) Expand all Loading... |
1051 defer googleapi.CloseBody(res) | 1051 defer googleapi.CloseBody(res) |
1052 if err := googleapi.CheckResponse(res); err != nil { | 1052 if err := googleapi.CheckResponse(res); err != nil { |
1053 return nil, err | 1053 return nil, err |
1054 } | 1054 } |
1055 ret := &LuciConfigGetConfigMultiResponseMessage{ | 1055 ret := &LuciConfigGetConfigMultiResponseMessage{ |
1056 ServerResponse: googleapi.ServerResponse{ | 1056 ServerResponse: googleapi.ServerResponse{ |
1057 Header: res.Header, | 1057 Header: res.Header, |
1058 HTTPStatusCode: res.StatusCode, | 1058 HTTPStatusCode: res.StatusCode, |
1059 }, | 1059 }, |
1060 } | 1060 } |
1061 » target := &ret | 1061 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
1062 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
1063 return nil, err | 1062 return nil, err |
1064 } | 1063 } |
1065 return ret, nil | 1064 return ret, nil |
1066 // { | 1065 // { |
1067 // "description": "Gets configs in all project config sets.", | 1066 // "description": "Gets configs in all project config sets.", |
1068 // "httpMethod": "GET", | 1067 // "httpMethod": "GET", |
1069 // "id": "config.get_project_configs", | 1068 // "id": "config.get_project_configs", |
1070 // "parameterOrder": [ | 1069 // "parameterOrder": [ |
1071 // "path" | 1070 // "path" |
1072 // ], | 1071 // ], |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 | 1127 |
1129 // Context sets the context to be used in this call's Do method. Any | 1128 // Context sets the context to be used in this call's Do method. Any |
1130 // pending HTTP request will be aborted if the provided context is | 1129 // pending HTTP request will be aborted if the provided context is |
1131 // canceled. | 1130 // canceled. |
1132 func (c *GetProjectsCall) Context(ctx context.Context) *GetProjectsCall { | 1131 func (c *GetProjectsCall) Context(ctx context.Context) *GetProjectsCall { |
1133 c.ctx_ = ctx | 1132 c.ctx_ = ctx |
1134 return c | 1133 return c |
1135 } | 1134 } |
1136 | 1135 |
1137 func (c *GetProjectsCall) doRequest(alt string) (*http.Response, error) { | 1136 func (c *GetProjectsCall) doRequest(alt string) (*http.Response, error) { |
1138 reqHeaders := make(http.Header) | |
1139 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
1140 if c.ifNoneMatch_ != "" { | |
1141 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
1142 } | |
1143 var body io.Reader = nil | 1137 var body io.Reader = nil |
1144 c.urlParams_.Set("alt", alt) | 1138 c.urlParams_.Set("alt", alt) |
1145 urls := googleapi.ResolveRelative(c.s.BasePath, "projects") | 1139 urls := googleapi.ResolveRelative(c.s.BasePath, "projects") |
1146 urls += "?" + c.urlParams_.Encode() | 1140 urls += "?" + c.urlParams_.Encode() |
1147 req, _ := http.NewRequest("GET", urls, body) | 1141 req, _ := http.NewRequest("GET", urls, body) |
1148 req.Header = reqHeaders | |
1149 googleapi.SetOpaque(req.URL) | 1142 googleapi.SetOpaque(req.URL) |
1150 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 1143 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 1144 » if c.ifNoneMatch_ != "" { |
| 1145 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 1146 » } |
| 1147 » if c.ctx_ != nil { |
| 1148 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 1149 » } |
| 1150 » return c.s.client.Do(req) |
1151 } | 1151 } |
1152 | 1152 |
1153 // Do executes the "config.get_projects" call. | 1153 // Do executes the "config.get_projects" call. |
1154 // Exactly one of *LuciConfigGetProjectsResponseMessage or error will be | 1154 // Exactly one of *LuciConfigGetProjectsResponseMessage or error will be |
1155 // non-nil. Any non-2xx status code is an error. Response headers are in | 1155 // non-nil. Any non-2xx status code is an error. Response headers are in |
1156 // either *LuciConfigGetProjectsResponseMessage.ServerResponse.Header or | 1156 // either *LuciConfigGetProjectsResponseMessage.ServerResponse.Header or |
1157 // (if a response was returned at all) in | 1157 // (if a response was returned at all) in |
1158 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check | 1158 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check |
1159 // whether the returned error was because http.StatusNotModified was | 1159 // whether the returned error was because http.StatusNotModified was |
1160 // returned. | 1160 // returned. |
(...skipping 15 matching lines...) Expand all Loading... |
1176 defer googleapi.CloseBody(res) | 1176 defer googleapi.CloseBody(res) |
1177 if err := googleapi.CheckResponse(res); err != nil { | 1177 if err := googleapi.CheckResponse(res); err != nil { |
1178 return nil, err | 1178 return nil, err |
1179 } | 1179 } |
1180 ret := &LuciConfigGetProjectsResponseMessage{ | 1180 ret := &LuciConfigGetProjectsResponseMessage{ |
1181 ServerResponse: googleapi.ServerResponse{ | 1181 ServerResponse: googleapi.ServerResponse{ |
1182 Header: res.Header, | 1182 Header: res.Header, |
1183 HTTPStatusCode: res.StatusCode, | 1183 HTTPStatusCode: res.StatusCode, |
1184 }, | 1184 }, |
1185 } | 1185 } |
1186 » target := &ret | 1186 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
1187 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
1188 return nil, err | 1187 return nil, err |
1189 } | 1188 } |
1190 return ret, nil | 1189 return ret, nil |
1191 // { | 1190 // { |
1192 // "description": "Gets list of registered projects. The project list
is stored in services/luci-config:projects.cfg.", | 1191 // "description": "Gets list of registered projects. The project list
is stored in services/luci-config:projects.cfg.", |
1193 // "httpMethod": "GET", | 1192 // "httpMethod": "GET", |
1194 // "id": "config.get_projects", | 1193 // "id": "config.get_projects", |
1195 // "path": "projects", | 1194 // "path": "projects", |
1196 // "response": { | 1195 // "response": { |
1197 // "$ref": "LuciConfigGetProjectsResponseMessage" | 1196 // "$ref": "LuciConfigGetProjectsResponseMessage" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 | 1245 |
1247 // Context sets the context to be used in this call's Do method. Any | 1246 // Context sets the context to be used in this call's Do method. Any |
1248 // pending HTTP request will be aborted if the provided context is | 1247 // pending HTTP request will be aborted if the provided context is |
1249 // canceled. | 1248 // canceled. |
1250 func (c *GetRefConfigsCall) Context(ctx context.Context) *GetRefConfigsCall { | 1249 func (c *GetRefConfigsCall) Context(ctx context.Context) *GetRefConfigsCall { |
1251 c.ctx_ = ctx | 1250 c.ctx_ = ctx |
1252 return c | 1251 return c |
1253 } | 1252 } |
1254 | 1253 |
1255 func (c *GetRefConfigsCall) doRequest(alt string) (*http.Response, error) { | 1254 func (c *GetRefConfigsCall) doRequest(alt string) (*http.Response, error) { |
1256 reqHeaders := make(http.Header) | |
1257 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
1258 if c.ifNoneMatch_ != "" { | |
1259 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
1260 } | |
1261 var body io.Reader = nil | 1255 var body io.Reader = nil |
1262 c.urlParams_.Set("alt", alt) | 1256 c.urlParams_.Set("alt", alt) |
1263 urls := googleapi.ResolveRelative(c.s.BasePath, "configs/refs/{path}") | 1257 urls := googleapi.ResolveRelative(c.s.BasePath, "configs/refs/{path}") |
1264 urls += "?" + c.urlParams_.Encode() | 1258 urls += "?" + c.urlParams_.Encode() |
1265 req, _ := http.NewRequest("GET", urls, body) | 1259 req, _ := http.NewRequest("GET", urls, body) |
1266 req.Header = reqHeaders | |
1267 googleapi.Expand(req.URL, map[string]string{ | 1260 googleapi.Expand(req.URL, map[string]string{ |
1268 "path": c.path, | 1261 "path": c.path, |
1269 }) | 1262 }) |
1270 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 1263 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 1264 » if c.ifNoneMatch_ != "" { |
| 1265 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 1266 » } |
| 1267 » if c.ctx_ != nil { |
| 1268 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 1269 » } |
| 1270 » return c.s.client.Do(req) |
1271 } | 1271 } |
1272 | 1272 |
1273 // Do executes the "config.get_ref_configs" call. | 1273 // Do executes the "config.get_ref_configs" call. |
1274 // Exactly one of *LuciConfigGetConfigMultiResponseMessage or error will | 1274 // Exactly one of *LuciConfigGetConfigMultiResponseMessage or error will |
1275 // be non-nil. Any non-2xx status code is an error. Response headers are | 1275 // be non-nil. Any non-2xx status code is an error. Response headers are |
1276 // in either | 1276 // in either |
1277 // *LuciConfigGetConfigMultiResponseMessage.ServerResponse.Header or (if | 1277 // *LuciConfigGetConfigMultiResponseMessage.ServerResponse.Header or (if |
1278 // a response was returned at all) in error.(*googleapi.Error).Header. | 1278 // a response was returned at all) in error.(*googleapi.Error).Header. |
1279 // Use googleapi.IsNotModified to check whether the returned error was | 1279 // Use googleapi.IsNotModified to check whether the returned error was |
1280 // because http.StatusNotModified was returned. | 1280 // because http.StatusNotModified was returned. |
(...skipping 15 matching lines...) Expand all Loading... |
1296 defer googleapi.CloseBody(res) | 1296 defer googleapi.CloseBody(res) |
1297 if err := googleapi.CheckResponse(res); err != nil { | 1297 if err := googleapi.CheckResponse(res); err != nil { |
1298 return nil, err | 1298 return nil, err |
1299 } | 1299 } |
1300 ret := &LuciConfigGetConfigMultiResponseMessage{ | 1300 ret := &LuciConfigGetConfigMultiResponseMessage{ |
1301 ServerResponse: googleapi.ServerResponse{ | 1301 ServerResponse: googleapi.ServerResponse{ |
1302 Header: res.Header, | 1302 Header: res.Header, |
1303 HTTPStatusCode: res.StatusCode, | 1303 HTTPStatusCode: res.StatusCode, |
1304 }, | 1304 }, |
1305 } | 1305 } |
1306 » target := &ret | 1306 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
1307 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
1308 return nil, err | 1307 return nil, err |
1309 } | 1308 } |
1310 return ret, nil | 1309 return ret, nil |
1311 // { | 1310 // { |
1312 // "description": "Gets configs in all ref config sets.", | 1311 // "description": "Gets configs in all ref config sets.", |
1313 // "httpMethod": "GET", | 1312 // "httpMethod": "GET", |
1314 // "id": "config.get_ref_configs", | 1313 // "id": "config.get_ref_configs", |
1315 // "parameterOrder": [ | 1314 // "parameterOrder": [ |
1316 // "path" | 1315 // "path" |
1317 // ], | 1316 // ], |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 | 1373 |
1375 // Context sets the context to be used in this call's Do method. Any | 1374 // Context sets the context to be used in this call's Do method. Any |
1376 // pending HTTP request will be aborted if the provided context is | 1375 // pending HTTP request will be aborted if the provided context is |
1377 // canceled. | 1376 // canceled. |
1378 func (c *GetRefsCall) Context(ctx context.Context) *GetRefsCall { | 1377 func (c *GetRefsCall) Context(ctx context.Context) *GetRefsCall { |
1379 c.ctx_ = ctx | 1378 c.ctx_ = ctx |
1380 return c | 1379 return c |
1381 } | 1380 } |
1382 | 1381 |
1383 func (c *GetRefsCall) doRequest(alt string) (*http.Response, error) { | 1382 func (c *GetRefsCall) doRequest(alt string) (*http.Response, error) { |
1384 reqHeaders := make(http.Header) | |
1385 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
1386 if c.ifNoneMatch_ != "" { | |
1387 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) | |
1388 } | |
1389 var body io.Reader = nil | 1383 var body io.Reader = nil |
1390 c.urlParams_.Set("alt", alt) | 1384 c.urlParams_.Set("alt", alt) |
1391 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project_id}/r
efs") | 1385 urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project_id}/r
efs") |
1392 urls += "?" + c.urlParams_.Encode() | 1386 urls += "?" + c.urlParams_.Encode() |
1393 req, _ := http.NewRequest("GET", urls, body) | 1387 req, _ := http.NewRequest("GET", urls, body) |
1394 req.Header = reqHeaders | |
1395 googleapi.Expand(req.URL, map[string]string{ | 1388 googleapi.Expand(req.URL, map[string]string{ |
1396 "project_id": c.projectId, | 1389 "project_id": c.projectId, |
1397 }) | 1390 }) |
1398 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 1391 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 1392 » if c.ifNoneMatch_ != "" { |
| 1393 » » req.Header.Set("If-None-Match", c.ifNoneMatch_) |
| 1394 » } |
| 1395 » if c.ctx_ != nil { |
| 1396 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 1397 » } |
| 1398 » return c.s.client.Do(req) |
1399 } | 1399 } |
1400 | 1400 |
1401 // Do executes the "config.get_refs" call. | 1401 // Do executes the "config.get_refs" call. |
1402 // Exactly one of *LuciConfigGetRefsResponseMessage or error will be | 1402 // Exactly one of *LuciConfigGetRefsResponseMessage or error will be |
1403 // non-nil. Any non-2xx status code is an error. Response headers are in | 1403 // non-nil. Any non-2xx status code is an error. Response headers are in |
1404 // either *LuciConfigGetRefsResponseMessage.ServerResponse.Header or (if | 1404 // either *LuciConfigGetRefsResponseMessage.ServerResponse.Header or (if |
1405 // a response was returned at all) in error.(*googleapi.Error).Header. | 1405 // a response was returned at all) in error.(*googleapi.Error).Header. |
1406 // Use googleapi.IsNotModified to check whether the returned error was | 1406 // Use googleapi.IsNotModified to check whether the returned error was |
1407 // because http.StatusNotModified was returned. | 1407 // because http.StatusNotModified was returned. |
1408 func (c *GetRefsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetRefsRespon
seMessage, error) { | 1408 func (c *GetRefsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetRefsRespon
seMessage, error) { |
(...skipping 14 matching lines...) Expand all Loading... |
1423 defer googleapi.CloseBody(res) | 1423 defer googleapi.CloseBody(res) |
1424 if err := googleapi.CheckResponse(res); err != nil { | 1424 if err := googleapi.CheckResponse(res); err != nil { |
1425 return nil, err | 1425 return nil, err |
1426 } | 1426 } |
1427 ret := &LuciConfigGetRefsResponseMessage{ | 1427 ret := &LuciConfigGetRefsResponseMessage{ |
1428 ServerResponse: googleapi.ServerResponse{ | 1428 ServerResponse: googleapi.ServerResponse{ |
1429 Header: res.Header, | 1429 Header: res.Header, |
1430 HTTPStatusCode: res.StatusCode, | 1430 HTTPStatusCode: res.StatusCode, |
1431 }, | 1431 }, |
1432 } | 1432 } |
1433 » target := &ret | 1433 » if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { |
1434 » if err := json.NewDecoder(res.Body).Decode(target); err != nil { | |
1435 return nil, err | 1434 return nil, err |
1436 } | 1435 } |
1437 return ret, nil | 1436 return ret, nil |
1438 // { | 1437 // { |
1439 // "description": "Gets list of refs of a project.", | 1438 // "description": "Gets list of refs of a project.", |
1440 // "httpMethod": "GET", | 1439 // "httpMethod": "GET", |
1441 // "id": "config.get_refs", | 1440 // "id": "config.get_refs", |
1442 // "parameterOrder": [ | 1441 // "parameterOrder": [ |
1443 // "project_id" | 1442 // "project_id" |
1444 // ], | 1443 // ], |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1485 | 1484 |
1486 // Context sets the context to be used in this call's Do method. Any | 1485 // Context sets the context to be used in this call's Do method. Any |
1487 // pending HTTP request will be aborted if the provided context is | 1486 // pending HTTP request will be aborted if the provided context is |
1488 // canceled. | 1487 // canceled. |
1489 func (c *ReimportCall) Context(ctx context.Context) *ReimportCall { | 1488 func (c *ReimportCall) Context(ctx context.Context) *ReimportCall { |
1490 c.ctx_ = ctx | 1489 c.ctx_ = ctx |
1491 return c | 1490 return c |
1492 } | 1491 } |
1493 | 1492 |
1494 func (c *ReimportCall) doRequest(alt string) (*http.Response, error) { | 1493 func (c *ReimportCall) doRequest(alt string) (*http.Response, error) { |
1495 reqHeaders := make(http.Header) | |
1496 reqHeaders.Set("User-Agent", c.s.userAgent()) | |
1497 var body io.Reader = nil | 1494 var body io.Reader = nil |
1498 c.urlParams_.Set("alt", alt) | 1495 c.urlParams_.Set("alt", alt) |
1499 urls := googleapi.ResolveRelative(c.s.BasePath, "reimport") | 1496 urls := googleapi.ResolveRelative(c.s.BasePath, "reimport") |
1500 urls += "?" + c.urlParams_.Encode() | 1497 urls += "?" + c.urlParams_.Encode() |
1501 req, _ := http.NewRequest("POST", urls, body) | 1498 req, _ := http.NewRequest("POST", urls, body) |
1502 req.Header = reqHeaders | |
1503 googleapi.SetOpaque(req.URL) | 1499 googleapi.SetOpaque(req.URL) |
1504 » return gensupport.SendRequest(c.ctx_, c.s.client, req) | 1500 » req.Header.Set("User-Agent", c.s.userAgent()) |
| 1501 » if c.ctx_ != nil { |
| 1502 » » return ctxhttp.Do(c.ctx_, c.s.client, req) |
| 1503 » } |
| 1504 » return c.s.client.Do(req) |
1505 } | 1505 } |
1506 | 1506 |
1507 // Do executes the "config.reimport" call. | 1507 // Do executes the "config.reimport" call. |
1508 func (c *ReimportCall) Do(opts ...googleapi.CallOption) error { | 1508 func (c *ReimportCall) Do(opts ...googleapi.CallOption) error { |
1509 gensupport.SetOptions(c.urlParams_, opts...) | 1509 gensupport.SetOptions(c.urlParams_, opts...) |
1510 res, err := c.doRequest("json") | 1510 res, err := c.doRequest("json") |
1511 if err != nil { | 1511 if err != nil { |
1512 return err | 1512 return err |
1513 } | 1513 } |
1514 defer googleapi.CloseBody(res) | 1514 defer googleapi.CloseBody(res) |
(...skipping 15 matching lines...) Expand all Loading... |
1530 // "type": "string" | 1530 // "type": "string" |
1531 // } | 1531 // } |
1532 // }, | 1532 // }, |
1533 // "path": "reimport", | 1533 // "path": "reimport", |
1534 // "scopes": [ | 1534 // "scopes": [ |
1535 // "https://www.googleapis.com/auth/userinfo.email" | 1535 // "https://www.googleapis.com/auth/userinfo.email" |
1536 // ] | 1536 // ] |
1537 // } | 1537 // } |
1538 | 1538 |
1539 } | 1539 } |
OLD | NEW |