From 4350101fdd1fda1c263b881bc765a6ff39745672 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:22:08 +0000 Subject: [PATCH] fix(deps): update module google.golang.org/api to v0.211.0 --- go.mod | 8 +- go.sum | 16 +- vendor/cloud.google.com/go/auth/CHANGES.md | 19 + .../go/auth/grpctransport/grpctransport.go | 9 - .../go/auth/httptransport/trace.go | 93 - .../go/auth/httptransport/transport.go | 14 - .../go/auth/internal/compute/compute.go | 3 +- .../go.opencensus.io/plugin/ocgrpc/client.go | 56 - .../plugin/ocgrpc/client_metrics.go | 118 - .../plugin/ocgrpc/client_stats_handler.go | 49 - vendor/go.opencensus.io/plugin/ocgrpc/doc.go | 19 - .../go.opencensus.io/plugin/ocgrpc/server.go | 81 - .../plugin/ocgrpc/server_metrics.go | 108 - .../plugin/ocgrpc/server_stats_handler.go | 63 - .../plugin/ocgrpc/stats_common.go | 248 - .../plugin/ocgrpc/trace_common.go | 107 - .../go.opencensus.io/plugin/ochttp/client.go | 117 - .../plugin/ochttp/client_stats.go | 143 - vendor/go.opencensus.io/plugin/ochttp/doc.go | 19 - .../plugin/ochttp/propagation/b3/b3.go | 123 - .../go.opencensus.io/plugin/ochttp/route.go | 61 - .../go.opencensus.io/plugin/ochttp/server.go | 455 - .../ochttp/span_annotating_client_trace.go | 169 - .../go.opencensus.io/plugin/ochttp/stats.go | 292 - .../go.opencensus.io/plugin/ochttp/trace.go | 244 - .../plugin/ochttp/wrapped_body.go | 44 - .../trace/propagation/propagation.go | 108 - .../api/compute/v1/compute-api.json | 4139 ++- .../api/compute/v1/compute-gen.go | 1282 +- .../api/compute/v1/compute2-gen.go | 22403 ++++++++-------- .../api/compute/v1/compute3-gen.go | 7889 +++--- .../google.golang.org/api/internal/version.go | 2 +- .../api/transport/grpc/dial.go | 9 - .../api/transport/http/dial.go | 15 - .../http/internal/propagation/http.go | 87 - vendor/modules.txt | 13 +- 36 files changed, 20112 insertions(+), 18513 deletions(-) delete mode 100644 vendor/cloud.google.com/go/auth/httptransport/trace.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/client.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/doc.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/server.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go delete mode 100644 vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/client.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/client_stats.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/doc.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/route.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/server.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/stats.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/trace.go delete mode 100644 vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go delete mode 100644 vendor/go.opencensus.io/trace/propagation/propagation.go delete mode 100644 vendor/google.golang.org/api/transport/http/internal/propagation/http.go diff --git a/go.mod b/go.mod index 8abe7e4bfbfe8..2d780d191c5ab 100644 --- a/go.mod +++ b/go.mod @@ -103,7 +103,7 @@ require ( golang.org/x/sync v0.10.0 golang.org/x/sys v0.28.0 golang.org/x/time v0.8.0 - google.golang.org/api v0.210.0 + google.golang.org/api v0.211.0 google.golang.org/grpc v1.68.1 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 @@ -154,7 +154,7 @@ require ( require ( cel.dev/expr v0.16.1 // indirect - cloud.google.com/go/auth v0.11.0 // indirect + cloud.google.com/go/auth v0.12.1 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect cloud.google.com/go/monitoring v1.21.2 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect @@ -364,8 +364,8 @@ require ( golang.org/x/term v0.27.0 // indirect golang.org/x/tools v0.23.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 + google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect diff --git a/go.sum b/go.sum index e65383cb18d65..9dc83cf5db986 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,8 @@ cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEar cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= -cloud.google.com/go/auth v0.11.0 h1:Ic5SZz2lsvbYcWT5dfjNWgw6tTlGi2Wc8hyQSC9BstA= -cloud.google.com/go/auth v0.11.0/go.mod h1:xxA5AqpDrvS+Gkmo9RqrGGRh6WSNKKOXhY3zNOr38tI= +cloud.google.com/go/auth v0.12.1 h1:n2Bj25BUMM0nvE9D2XLTiImanwZhO3DkfWSYS/SAJP4= +cloud.google.com/go/auth v0.12.1/go.mod h1:BFMu+TNpF3DmvfBO9ClqTR/SiqVIm7LukKF9mbendF4= cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU= cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= @@ -3490,8 +3490,8 @@ google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZ google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/api v0.210.0 h1:HMNffZ57OoZCRYSbdWVRoqOa8V8NIHLL0CzdBPLztWk= -google.golang.org/api v0.210.0/go.mod h1:B9XDZGnx2NtyjzVkOVTGrFSAVZgPcbedzKg/gTLwqBs= +google.golang.org/api v0.211.0 h1:IUpLjq09jxBSV1lACO33CGY3jsRcbctfGzhj+ZSE/Bg= +google.golang.org/api v0.211.0/go.mod h1:XOloB4MXFH4UTlQSGuNUxw0UT74qdENK8d6JNsXKLi0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -3658,8 +3658,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go. google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:mPBs5jNgx2GuQGvFwUvVKqtn6HsUw9nP64BedgvqEsQ= google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f h1:M65LEviCfuZTfrfzwwEoxVtgvfkFkBUbFnRbxCXuXhU= -google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f/go.mod h1:Yo94eF2nj7igQt+TiJ49KxjIH8ndLYPZMIRSiRcEbg0= +google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 h1:pgr/4QbFyktUv9CtQ/Fq4gzEE6/Xs7iCXbktaGzLHbQ= +google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697/go.mod h1:+D9ySVjN8nY8YCVjc5O7PZDIdZporIDY3KaGfJunh88= google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= @@ -3668,8 +3668,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20230629202037-9506855d4529/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 h1:LWZqQOEjDyONlF1H6afSWpAL/znlREo2tHfLoe+8LMA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 h1:IfdSdTcLFy4lqUQrQJLkLt1PB+AsqVz6lwkWPzWEz10= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index 351392defd45a..4d112f8006388 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,24 @@ # Changelog +## [0.12.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.12.0...auth/v0.12.1) (2024-12-10) + + +### Bug Fixes + +* **auth:** Correct typo in link ([#11160](https://github.com/googleapis/google-cloud-go/issues/11160)) ([af6fb46](https://github.com/googleapis/google-cloud-go/commit/af6fb46d7cd694ddbe8c9d63bc4cdcd62b9fb2c1)) + +## [0.12.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.11.0...auth/v0.12.0) (2024-12-04) + + +### Features + +* **auth:** Add support for providing custom certificate URL ([#11006](https://github.com/googleapis/google-cloud-go/issues/11006)) ([ebf3657](https://github.com/googleapis/google-cloud-go/commit/ebf36579724afb375d3974cf1da38f703e3b7dbc)), refs [#11005](https://github.com/googleapis/google-cloud-go/issues/11005) + + +### Bug Fixes + +* **auth:** Ensure endpoints are present in Validator ([#11209](https://github.com/googleapis/google-cloud-go/issues/11209)) ([106cd53](https://github.com/googleapis/google-cloud-go/commit/106cd53309facaef1b8ea78376179f523f6912b9)), refs [#11006](https://github.com/googleapis/google-cloud-go/issues/11006) [#11190](https://github.com/googleapis/google-cloud-go/issues/11190) [#11189](https://github.com/googleapis/google-cloud-go/issues/11189) [#11188](https://github.com/googleapis/google-cloud-go/issues/11188) + ## [0.11.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.10.2...auth/v0.11.0) (2024-11-21) diff --git a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go index 38212ed0f82a0..fb82686e57d58 100644 --- a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go +++ b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go @@ -29,7 +29,6 @@ import ( "cloud.google.com/go/auth/credentials" "cloud.google.com/go/auth/internal" "cloud.google.com/go/auth/internal/transport" - "go.opencensus.io/plugin/ocgrpc" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "google.golang.org/grpc" grpccreds "google.golang.org/grpc/credentials" @@ -318,7 +317,6 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er // Add tracing, but before the other options, so that clients can override the // gRPC stats handler. // This assumes that gRPC options are processed in order, left to right. - grpcOpts = addOCStatsHandler(grpcOpts, opts) grpcOpts = addOpenTelemetryStatsHandler(grpcOpts, opts) grpcOpts = append(grpcOpts, opts.GRPCDialOpts...) @@ -417,13 +415,6 @@ func (c *grpcCredentialsProvider) RequireTransportSecurity() bool { return c.secure } -func addOCStatsHandler(dialOpts []grpc.DialOption, opts *Options) []grpc.DialOption { - if opts.DisableTelemetry { - return dialOpts - } - return append(dialOpts, grpc.WithStatsHandler(&ocgrpc.ClientHandler{})) -} - func addOpenTelemetryStatsHandler(dialOpts []grpc.DialOption, opts *Options) []grpc.DialOption { if opts.DisableTelemetry { return dialOpts diff --git a/vendor/cloud.google.com/go/auth/httptransport/trace.go b/vendor/cloud.google.com/go/auth/httptransport/trace.go deleted file mode 100644 index 467c477c04df6..0000000000000 --- a/vendor/cloud.google.com/go/auth/httptransport/trace.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2023 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httptransport - -import ( - "encoding/binary" - "encoding/hex" - "fmt" - "net/http" - "strconv" - "strings" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -const ( - httpHeaderMaxSize = 200 - cloudTraceHeader = `X-Cloud-Trace-Context` -) - -// asserts the httpFormat fulfills this foreign interface -var _ propagation.HTTPFormat = (*httpFormat)(nil) - -// httpFormat implements propagation.httpFormat to propagate -// traces in HTTP headers for Google Cloud Platform and Cloud Trace. -type httpFormat struct{} - -// SpanContextFromRequest extracts a Cloud Trace span context from incoming requests. -func (f *httpFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) { - h := req.Header.Get(cloudTraceHeader) - // See https://cloud.google.com/trace/docs/faq for the header HTTPFormat. - // Return if the header is empty or missing, or if the header is unreasonably - // large, to avoid making unnecessary copies of a large string. - if h == "" || len(h) > httpHeaderMaxSize { - return trace.SpanContext{}, false - } - - // Parse the trace id field. - slash := strings.Index(h, `/`) - if slash == -1 { - return trace.SpanContext{}, false - } - tid, h := h[:slash], h[slash+1:] - - buf, err := hex.DecodeString(tid) - if err != nil { - return trace.SpanContext{}, false - } - copy(sc.TraceID[:], buf) - - // Parse the span id field. - spanstr := h - semicolon := strings.Index(h, `;`) - if semicolon != -1 { - spanstr, h = h[:semicolon], h[semicolon+1:] - } - sid, err := strconv.ParseUint(spanstr, 10, 64) - if err != nil { - return trace.SpanContext{}, false - } - binary.BigEndian.PutUint64(sc.SpanID[:], sid) - - // Parse the options field, options field is optional. - if !strings.HasPrefix(h, "o=") { - return sc, true - } - o, err := strconv.ParseUint(h[2:], 10, 32) - if err != nil { - return trace.SpanContext{}, false - } - sc.TraceOptions = trace.TraceOptions(o) - return sc, true -} - -// SpanContextToRequest modifies the given request to include a Cloud Trace header. -func (f *httpFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { - sid := binary.BigEndian.Uint64(sc.SpanID[:]) - header := fmt.Sprintf("%s/%d;o=%d", hex.EncodeToString(sc.TraceID[:]), sid, int64(sc.TraceOptions)) - req.Header.Set(cloudTraceHeader, header) -} diff --git a/vendor/cloud.google.com/go/auth/httptransport/transport.go b/vendor/cloud.google.com/go/auth/httptransport/transport.go index 1d139b9dc49eb..ee215b6dc6cb9 100644 --- a/vendor/cloud.google.com/go/auth/httptransport/transport.go +++ b/vendor/cloud.google.com/go/auth/httptransport/transport.go @@ -27,7 +27,6 @@ import ( "cloud.google.com/go/auth/internal" "cloud.google.com/go/auth/internal/transport" "cloud.google.com/go/auth/internal/transport/cert" - "go.opencensus.io/plugin/ochttp" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "golang.org/x/net/http2" ) @@ -43,10 +42,7 @@ func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, err headers: headers, } var trans http.RoundTripper = ht - // Give OpenTelemetry precedence over OpenCensus in case user configuration - // causes both to write the same header (`X-Cloud-Trace-Context`). trans = addOpenTelemetryTransport(trans, opts) - trans = addOCTransport(trans, opts) switch { case opts.DisableAuthentication: // Do nothing. @@ -179,16 +175,6 @@ func addOpenTelemetryTransport(trans http.RoundTripper, opts *Options) http.Roun return otelhttp.NewTransport(trans) } -func addOCTransport(trans http.RoundTripper, opts *Options) http.RoundTripper { - if opts.DisableTelemetry { - return trans - } - return &ochttp.Transport{ - Base: trans, - Propagation: &httpFormat{}, - } -} - type authTransport struct { creds *auth.Credentials base http.RoundTripper diff --git a/vendor/cloud.google.com/go/auth/internal/compute/compute.go b/vendor/cloud.google.com/go/auth/internal/compute/compute.go index 651bd61fbbc24..05c7e8bdd49ff 100644 --- a/vendor/cloud.google.com/go/auth/internal/compute/compute.go +++ b/vendor/cloud.google.com/go/auth/internal/compute/compute.go @@ -31,8 +31,7 @@ var ( // This is a copy of the gRPC internal googlecloud.OnGCE() func at: // https://github.com/grpc/grpc-go/blob/master/internal/googlecloud/googlecloud.go // The functionality is similar to the metadata.OnGCE() func at: -// https://github.com/xmenxk/google-cloud-go/blob/main/compute/metadata/metadata.go -// +// https://github.com/googleapis/google-cloud-go/blob/main/compute/metadata/metadata.go // The difference is that OnComputeEngine() does not perform HTTP or DNS check on the metadata server. // In particular, OnComputeEngine() will return false on Serverless. func OnComputeEngine() bool { diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client.go b/vendor/go.opencensus.io/plugin/ocgrpc/client.go deleted file mode 100644 index 2063b6f76a1b1..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/client.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ocgrpc - -import ( - "context" - - "go.opencensus.io/trace" - "google.golang.org/grpc/stats" -) - -// ClientHandler implements a gRPC stats.Handler for recording OpenCensus stats and -// traces. Use with gRPC clients only. -type ClientHandler struct { - // StartOptions allows configuring the StartOptions used to create new spans. - // - // StartOptions.SpanKind will always be set to trace.SpanKindClient - // for spans started by this handler. - StartOptions trace.StartOptions -} - -// HandleConn exists to satisfy gRPC stats.Handler. -func (c *ClientHandler) HandleConn(ctx context.Context, cs stats.ConnStats) { - // no-op -} - -// TagConn exists to satisfy gRPC stats.Handler. -func (c *ClientHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context { - // no-op - return ctx -} - -// HandleRPC implements per-RPC tracing and stats instrumentation. -func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { - traceHandleRPC(ctx, rs) - statsHandleRPC(ctx, rs) -} - -// TagRPC implements per-RPC context management. -func (c *ClientHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context { - ctx = c.traceTagRPC(ctx, rti) - ctx = c.statsTagRPC(ctx, rti) - return ctx -} diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go b/vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go deleted file mode 100644 index fb3c19d6b646d..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/client_metrics.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package ocgrpc - -import ( - "go.opencensus.io/stats" - "go.opencensus.io/stats/view" - "go.opencensus.io/tag" -) - -// The following variables are measures are recorded by ClientHandler: -var ( - ClientSentMessagesPerRPC = stats.Int64("grpc.io/client/sent_messages_per_rpc", "Number of messages sent in the RPC (always 1 for non-streaming RPCs).", stats.UnitDimensionless) - ClientSentBytesPerRPC = stats.Int64("grpc.io/client/sent_bytes_per_rpc", "Total bytes sent across all request messages per RPC.", stats.UnitBytes) - ClientReceivedMessagesPerRPC = stats.Int64("grpc.io/client/received_messages_per_rpc", "Number of response messages received per RPC (always 1 for non-streaming RPCs).", stats.UnitDimensionless) - ClientReceivedBytesPerRPC = stats.Int64("grpc.io/client/received_bytes_per_rpc", "Total bytes received across all response messages per RPC.", stats.UnitBytes) - ClientRoundtripLatency = stats.Float64("grpc.io/client/roundtrip_latency", "Time between first byte of request sent to last byte of response received, or terminal error.", stats.UnitMilliseconds) - ClientStartedRPCs = stats.Int64("grpc.io/client/started_rpcs", "Number of started client RPCs.", stats.UnitDimensionless) - ClientServerLatency = stats.Float64("grpc.io/client/server_latency", `Propagated from the server and should have the same value as "grpc.io/server/latency".`, stats.UnitMilliseconds) -) - -// Predefined views may be registered to collect data for the above measures. -// As always, you may also define your own custom views over measures collected by this -// package. These are declared as a convenience only; none are registered by -// default. -var ( - ClientSentBytesPerRPCView = &view.View{ - Measure: ClientSentBytesPerRPC, - Name: "grpc.io/client/sent_bytes_per_rpc", - Description: "Distribution of bytes sent per RPC, by method.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: DefaultBytesDistribution, - } - - ClientReceivedBytesPerRPCView = &view.View{ - Measure: ClientReceivedBytesPerRPC, - Name: "grpc.io/client/received_bytes_per_rpc", - Description: "Distribution of bytes received per RPC, by method.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: DefaultBytesDistribution, - } - - ClientRoundtripLatencyView = &view.View{ - Measure: ClientRoundtripLatency, - Name: "grpc.io/client/roundtrip_latency", - Description: "Distribution of round-trip latency, by method.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: DefaultMillisecondsDistribution, - } - - // Purposely reuses the count from `ClientRoundtripLatency`, tagging - // with method and status to result in ClientCompletedRpcs. - ClientCompletedRPCsView = &view.View{ - Measure: ClientRoundtripLatency, - Name: "grpc.io/client/completed_rpcs", - Description: "Count of RPCs by method and status.", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - Aggregation: view.Count(), - } - - ClientStartedRPCsView = &view.View{ - Measure: ClientStartedRPCs, - Name: "grpc.io/client/started_rpcs", - Description: "Number of started client RPCs.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: view.Count(), - } - - ClientSentMessagesPerRPCView = &view.View{ - Measure: ClientSentMessagesPerRPC, - Name: "grpc.io/client/sent_messages_per_rpc", - Description: "Distribution of sent messages count per RPC, by method.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: DefaultMessageCountDistribution, - } - - ClientReceivedMessagesPerRPCView = &view.View{ - Measure: ClientReceivedMessagesPerRPC, - Name: "grpc.io/client/received_messages_per_rpc", - Description: "Distribution of received messages count per RPC, by method.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: DefaultMessageCountDistribution, - } - - ClientServerLatencyView = &view.View{ - Measure: ClientServerLatency, - Name: "grpc.io/client/server_latency", - Description: "Distribution of server latency as viewed by client, by method.", - TagKeys: []tag.Key{KeyClientMethod}, - Aggregation: DefaultMillisecondsDistribution, - } -) - -// DefaultClientViews are the default client views provided by this package. -var DefaultClientViews = []*view.View{ - ClientSentBytesPerRPCView, - ClientReceivedBytesPerRPCView, - ClientRoundtripLatencyView, - ClientCompletedRPCsView, -} - -// TODO(jbd): Add roundtrip_latency, uncompressed_request_bytes, uncompressed_response_bytes, request_count, response_count. -// TODO(acetechnologist): This is temporary and will need to be replaced by a -// mechanism to load these defaults from a common repository/config shared by -// all supported languages. Likely a serialized protobuf of these defaults. diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go b/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go deleted file mode 100644 index b36349820d935..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/client_stats_handler.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package ocgrpc - -import ( - "context" - "time" - - "go.opencensus.io/tag" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/stats" -) - -// statsTagRPC gets the tag.Map populated by the application code, serializes -// its tags into the GRPC metadata in order to be sent to the server. -func (h *ClientHandler) statsTagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - startTime := time.Now() - if info == nil { - if grpclog.V(2) { - grpclog.Info("clientHandler.TagRPC called with nil info.") - } - return ctx - } - - d := &rpcData{ - startTime: startTime, - method: info.FullMethodName, - } - ts := tag.FromContext(ctx) - if ts != nil { - encoded := tag.Encode(ts) - ctx = stats.SetTags(ctx, encoded) - } - - return context.WithValue(ctx, rpcDataKey, d) -} diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/doc.go b/vendor/go.opencensus.io/plugin/ocgrpc/doc.go deleted file mode 100644 index 1370323fb711e..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ocgrpc contains OpenCensus stats and trace -// integrations for gRPC. -// -// Use ServerHandler for servers and ClientHandler for clients. -package ocgrpc // import "go.opencensus.io/plugin/ocgrpc" diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server.go b/vendor/go.opencensus.io/plugin/ocgrpc/server.go deleted file mode 100644 index 8a53e097274cb..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/server.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ocgrpc - -import ( - "context" - - "google.golang.org/grpc/stats" - - "go.opencensus.io/trace" -) - -// ServerHandler implements gRPC stats.Handler recording OpenCensus stats and -// traces. Use with gRPC servers. -// -// When installed (see Example), tracing metadata is read from inbound RPCs -// by default. If no tracing metadata is present, or if the tracing metadata is -// present but the SpanContext isn't sampled, then a new trace may be started -// (as determined by Sampler). -type ServerHandler struct { - // IsPublicEndpoint may be set to true to always start a new trace around - // each RPC. Any SpanContext in the RPC metadata will be added as a linked - // span instead of making it the parent of the span created around the - // server RPC. - // - // Be aware that if you leave this false (the default) on a public-facing - // server, callers will be able to send tracing metadata in gRPC headers - // and trigger traces in your backend. - IsPublicEndpoint bool - - // StartOptions to use for to spans started around RPCs handled by this server. - // - // These will apply even if there is tracing metadata already - // present on the inbound RPC but the SpanContext is not sampled. This - // ensures that each service has some opportunity to be traced. If you would - // like to not add any additional traces for this gRPC service, set: - // - // StartOptions.Sampler = trace.ProbabilitySampler(0.0) - // - // StartOptions.SpanKind will always be set to trace.SpanKindServer - // for spans started by this handler. - StartOptions trace.StartOptions -} - -var _ stats.Handler = (*ServerHandler)(nil) - -// HandleConn exists to satisfy gRPC stats.Handler. -func (s *ServerHandler) HandleConn(ctx context.Context, cs stats.ConnStats) { - // no-op -} - -// TagConn exists to satisfy gRPC stats.Handler. -func (s *ServerHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context { - // no-op - return ctx -} - -// HandleRPC implements per-RPC tracing and stats instrumentation. -func (s *ServerHandler) HandleRPC(ctx context.Context, rs stats.RPCStats) { - traceHandleRPC(ctx, rs) - statsHandleRPC(ctx, rs) -} - -// TagRPC implements per-RPC context management. -func (s *ServerHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context { - ctx = s.traceTagRPC(ctx, rti) - ctx = s.statsTagRPC(ctx, rti) - return ctx -} diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go b/vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go deleted file mode 100644 index fe0e971086e6a..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/server_metrics.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package ocgrpc - -import ( - "go.opencensus.io/stats" - "go.opencensus.io/stats/view" - "go.opencensus.io/tag" -) - -// The following variables are measures are recorded by ServerHandler: -var ( - ServerReceivedMessagesPerRPC = stats.Int64("grpc.io/server/received_messages_per_rpc", "Number of messages received in each RPC. Has value 1 for non-streaming RPCs.", stats.UnitDimensionless) - ServerReceivedBytesPerRPC = stats.Int64("grpc.io/server/received_bytes_per_rpc", "Total bytes received across all messages per RPC.", stats.UnitBytes) - ServerSentMessagesPerRPC = stats.Int64("grpc.io/server/sent_messages_per_rpc", "Number of messages sent in each RPC. Has value 1 for non-streaming RPCs.", stats.UnitDimensionless) - ServerSentBytesPerRPC = stats.Int64("grpc.io/server/sent_bytes_per_rpc", "Total bytes sent in across all response messages per RPC.", stats.UnitBytes) - ServerStartedRPCs = stats.Int64("grpc.io/server/started_rpcs", "Number of started server RPCs.", stats.UnitDimensionless) - ServerLatency = stats.Float64("grpc.io/server/server_latency", "Time between first byte of request received to last byte of response sent, or terminal error.", stats.UnitMilliseconds) -) - -// TODO(acetechnologist): This is temporary and will need to be replaced by a -// mechanism to load these defaults from a common repository/config shared by -// all supported languages. Likely a serialized protobuf of these defaults. - -// Predefined views may be registered to collect data for the above measures. -// As always, you may also define your own custom views over measures collected by this -// package. These are declared as a convenience only; none are registered by -// default. -var ( - ServerReceivedBytesPerRPCView = &view.View{ - Name: "grpc.io/server/received_bytes_per_rpc", - Description: "Distribution of received bytes per RPC, by method.", - Measure: ServerReceivedBytesPerRPC, - TagKeys: []tag.Key{KeyServerMethod}, - Aggregation: DefaultBytesDistribution, - } - - ServerSentBytesPerRPCView = &view.View{ - Name: "grpc.io/server/sent_bytes_per_rpc", - Description: "Distribution of total sent bytes per RPC, by method.", - Measure: ServerSentBytesPerRPC, - TagKeys: []tag.Key{KeyServerMethod}, - Aggregation: DefaultBytesDistribution, - } - - ServerLatencyView = &view.View{ - Name: "grpc.io/server/server_latency", - Description: "Distribution of server latency in milliseconds, by method.", - TagKeys: []tag.Key{KeyServerMethod}, - Measure: ServerLatency, - Aggregation: DefaultMillisecondsDistribution, - } - - // Purposely reuses the count from `ServerLatency`, tagging - // with method and status to result in ServerCompletedRpcs. - ServerCompletedRPCsView = &view.View{ - Name: "grpc.io/server/completed_rpcs", - Description: "Count of RPCs by method and status.", - TagKeys: []tag.Key{KeyServerMethod, KeyServerStatus}, - Measure: ServerLatency, - Aggregation: view.Count(), - } - - ServerStartedRPCsView = &view.View{ - Measure: ServerStartedRPCs, - Name: "grpc.io/server/started_rpcs", - Description: "Number of started server RPCs.", - TagKeys: []tag.Key{KeyServerMethod}, - Aggregation: view.Count(), - } - - ServerReceivedMessagesPerRPCView = &view.View{ - Name: "grpc.io/server/received_messages_per_rpc", - Description: "Distribution of messages received count per RPC, by method.", - TagKeys: []tag.Key{KeyServerMethod}, - Measure: ServerReceivedMessagesPerRPC, - Aggregation: DefaultMessageCountDistribution, - } - - ServerSentMessagesPerRPCView = &view.View{ - Name: "grpc.io/server/sent_messages_per_rpc", - Description: "Distribution of messages sent count per RPC, by method.", - TagKeys: []tag.Key{KeyServerMethod}, - Measure: ServerSentMessagesPerRPC, - Aggregation: DefaultMessageCountDistribution, - } -) - -// DefaultServerViews are the default server views provided by this package. -var DefaultServerViews = []*view.View{ - ServerReceivedBytesPerRPCView, - ServerSentBytesPerRPCView, - ServerLatencyView, - ServerCompletedRPCsView, -} diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go b/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go deleted file mode 100644 index afcef023afb71..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/server_stats_handler.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package ocgrpc - -import ( - "time" - - "context" - - "go.opencensus.io/tag" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/stats" -) - -// statsTagRPC gets the metadata from gRPC context, extracts the encoded tags from -// it and creates a new tag.Map and puts them into the returned context. -func (h *ServerHandler) statsTagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context { - startTime := time.Now() - if info == nil { - if grpclog.V(2) { - grpclog.Infof("opencensus: TagRPC called with nil info.") - } - return ctx - } - d := &rpcData{ - startTime: startTime, - method: info.FullMethodName, - } - propagated := h.extractPropagatedTags(ctx) - ctx = tag.NewContext(ctx, propagated) - ctx, _ = tag.New(ctx, tag.Upsert(KeyServerMethod, methodName(info.FullMethodName))) - return context.WithValue(ctx, rpcDataKey, d) -} - -// extractPropagatedTags creates a new tag map containing the tags extracted from the -// gRPC metadata. -func (h *ServerHandler) extractPropagatedTags(ctx context.Context) *tag.Map { - buf := stats.Tags(ctx) - if buf == nil { - return nil - } - propagated, err := tag.Decode(buf) - if err != nil { - if grpclog.V(2) { - grpclog.Warningf("opencensus: Failed to decode tags from gRPC metadata failed to decode: %v", err) - } - return nil - } - return propagated -} diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go b/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go deleted file mode 100644 index 9cb27320ca132..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/stats_common.go +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -package ocgrpc - -import ( - "context" - "strconv" - "strings" - "sync/atomic" - "time" - - "go.opencensus.io/metric/metricdata" - ocstats "go.opencensus.io/stats" - "go.opencensus.io/stats/view" - "go.opencensus.io/tag" - "go.opencensus.io/trace" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/stats" - "google.golang.org/grpc/status" -) - -type grpcInstrumentationKey string - -// rpcData holds the instrumentation RPC data that is needed between the start -// and end of an call. It holds the info that this package needs to keep track -// of between the various GRPC events. -type rpcData struct { - // reqCount and respCount has to be the first words - // in order to be 64-aligned on 32-bit architectures. - sentCount, sentBytes, recvCount, recvBytes int64 // access atomically - - // startTime represents the time at which TagRPC was invoked at the - // beginning of an RPC. It is an appoximation of the time when the - // application code invoked GRPC code. - startTime time.Time - method string -} - -// The following variables define the default hard-coded auxiliary data used by -// both the default GRPC client and GRPC server metrics. -var ( - DefaultBytesDistribution = view.Distribution(1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296) - DefaultMillisecondsDistribution = view.Distribution(0.01, 0.05, 0.1, 0.3, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000) - DefaultMessageCountDistribution = view.Distribution(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536) -) - -// Server tags are applied to the context used to process each RPC, as well as -// the measures at the end of each RPC. -var ( - KeyServerMethod = tag.MustNewKey("grpc_server_method") - KeyServerStatus = tag.MustNewKey("grpc_server_status") -) - -// Client tags are applied to measures at the end of each RPC. -var ( - KeyClientMethod = tag.MustNewKey("grpc_client_method") - KeyClientStatus = tag.MustNewKey("grpc_client_status") -) - -var ( - rpcDataKey = grpcInstrumentationKey("opencensus-rpcData") -) - -func methodName(fullname string) string { - return strings.TrimLeft(fullname, "/") -} - -// statsHandleRPC processes the RPC events. -func statsHandleRPC(ctx context.Context, s stats.RPCStats) { - switch st := s.(type) { - case *stats.OutHeader, *stats.InHeader, *stats.InTrailer, *stats.OutTrailer: - // do nothing for client - case *stats.Begin: - handleRPCBegin(ctx, st) - case *stats.OutPayload: - handleRPCOutPayload(ctx, st) - case *stats.InPayload: - handleRPCInPayload(ctx, st) - case *stats.End: - handleRPCEnd(ctx, st) - default: - grpclog.Infof("unexpected stats: %T", st) - } -} - -func handleRPCBegin(ctx context.Context, s *stats.Begin) { - d, ok := ctx.Value(rpcDataKey).(*rpcData) - if !ok { - if grpclog.V(2) { - grpclog.Infoln("Failed to retrieve *rpcData from context.") - } - } - - if s.IsClient() { - ocstats.RecordWithOptions(ctx, - ocstats.WithTags(tag.Upsert(KeyClientMethod, methodName(d.method))), - ocstats.WithMeasurements(ClientStartedRPCs.M(1))) - } else { - ocstats.RecordWithOptions(ctx, - ocstats.WithTags(tag.Upsert(KeyClientMethod, methodName(d.method))), - ocstats.WithMeasurements(ServerStartedRPCs.M(1))) - } -} - -func handleRPCOutPayload(ctx context.Context, s *stats.OutPayload) { - d, ok := ctx.Value(rpcDataKey).(*rpcData) - if !ok { - if grpclog.V(2) { - grpclog.Infoln("Failed to retrieve *rpcData from context.") - } - return - } - - atomic.AddInt64(&d.sentBytes, int64(s.Length)) - atomic.AddInt64(&d.sentCount, 1) -} - -func handleRPCInPayload(ctx context.Context, s *stats.InPayload) { - d, ok := ctx.Value(rpcDataKey).(*rpcData) - if !ok { - if grpclog.V(2) { - grpclog.Infoln("Failed to retrieve *rpcData from context.") - } - return - } - - atomic.AddInt64(&d.recvBytes, int64(s.Length)) - atomic.AddInt64(&d.recvCount, 1) -} - -func handleRPCEnd(ctx context.Context, s *stats.End) { - d, ok := ctx.Value(rpcDataKey).(*rpcData) - if !ok { - if grpclog.V(2) { - grpclog.Infoln("Failed to retrieve *rpcData from context.") - } - return - } - - elapsedTime := time.Since(d.startTime) - - var st string - if s.Error != nil { - s, ok := status.FromError(s.Error) - if ok { - st = statusCodeToString(s) - } - } else { - st = "OK" - } - - latencyMillis := float64(elapsedTime) / float64(time.Millisecond) - attachments := getSpanCtxAttachment(ctx) - if s.Client { - ocstats.RecordWithOptions(ctx, - ocstats.WithTags( - tag.Upsert(KeyClientMethod, methodName(d.method)), - tag.Upsert(KeyClientStatus, st)), - ocstats.WithAttachments(attachments), - ocstats.WithMeasurements( - ClientSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)), - ClientSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)), - ClientReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)), - ClientReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)), - ClientRoundtripLatency.M(latencyMillis))) - } else { - ocstats.RecordWithOptions(ctx, - ocstats.WithTags( - tag.Upsert(KeyServerStatus, st), - ), - ocstats.WithAttachments(attachments), - ocstats.WithMeasurements( - ServerSentBytesPerRPC.M(atomic.LoadInt64(&d.sentBytes)), - ServerSentMessagesPerRPC.M(atomic.LoadInt64(&d.sentCount)), - ServerReceivedMessagesPerRPC.M(atomic.LoadInt64(&d.recvCount)), - ServerReceivedBytesPerRPC.M(atomic.LoadInt64(&d.recvBytes)), - ServerLatency.M(latencyMillis))) - } -} - -func statusCodeToString(s *status.Status) string { - // see https://github.com/grpc/grpc/blob/master/doc/statuscodes.md - switch c := s.Code(); c { - case codes.OK: - return "OK" - case codes.Canceled: - return "CANCELLED" - case codes.Unknown: - return "UNKNOWN" - case codes.InvalidArgument: - return "INVALID_ARGUMENT" - case codes.DeadlineExceeded: - return "DEADLINE_EXCEEDED" - case codes.NotFound: - return "NOT_FOUND" - case codes.AlreadyExists: - return "ALREADY_EXISTS" - case codes.PermissionDenied: - return "PERMISSION_DENIED" - case codes.ResourceExhausted: - return "RESOURCE_EXHAUSTED" - case codes.FailedPrecondition: - return "FAILED_PRECONDITION" - case codes.Aborted: - return "ABORTED" - case codes.OutOfRange: - return "OUT_OF_RANGE" - case codes.Unimplemented: - return "UNIMPLEMENTED" - case codes.Internal: - return "INTERNAL" - case codes.Unavailable: - return "UNAVAILABLE" - case codes.DataLoss: - return "DATA_LOSS" - case codes.Unauthenticated: - return "UNAUTHENTICATED" - default: - return "CODE_" + strconv.FormatInt(int64(c), 10) - } -} - -func getSpanCtxAttachment(ctx context.Context) metricdata.Attachments { - attachments := map[string]interface{}{} - span := trace.FromContext(ctx) - if span == nil { - return attachments - } - spanCtx := span.SpanContext() - if spanCtx.IsSampled() { - attachments[metricdata.AttachmentKeySpanContext] = spanCtx - } - return attachments -} diff --git a/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go b/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go deleted file mode 100644 index 61bc543d0a25c..0000000000000 --- a/vendor/go.opencensus.io/plugin/ocgrpc/trace_common.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ocgrpc - -import ( - "context" - "strings" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/stats" - "google.golang.org/grpc/status" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -const traceContextKey = "grpc-trace-bin" - -// TagRPC creates a new trace span for the client side of the RPC. -// -// It returns ctx with the new trace span added and a serialization of the -// SpanContext added to the outgoing gRPC metadata. -func (c *ClientHandler) traceTagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context { - name := strings.TrimPrefix(rti.FullMethodName, "/") - name = strings.Replace(name, "/", ".", -1) - ctx, span := trace.StartSpan(ctx, name, - trace.WithSampler(c.StartOptions.Sampler), - trace.WithSpanKind(trace.SpanKindClient)) // span is ended by traceHandleRPC - traceContextBinary := propagation.Binary(span.SpanContext()) - return metadata.AppendToOutgoingContext(ctx, traceContextKey, string(traceContextBinary)) -} - -// TagRPC creates a new trace span for the server side of the RPC. -// -// It checks the incoming gRPC metadata in ctx for a SpanContext, and if -// it finds one, uses that SpanContext as the parent context of the new span. -// -// It returns ctx, with the new trace span added. -func (s *ServerHandler) traceTagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context { - md, _ := metadata.FromIncomingContext(ctx) - name := strings.TrimPrefix(rti.FullMethodName, "/") - name = strings.Replace(name, "/", ".", -1) - traceContext := md[traceContextKey] - var ( - parent trace.SpanContext - haveParent bool - ) - if len(traceContext) > 0 { - // Metadata with keys ending in -bin are actually binary. They are base64 - // encoded before being put on the wire, see: - // https://github.com/grpc/grpc-go/blob/08d6261/Documentation/grpc-metadata.md#storing-binary-data-in-metadata - traceContextBinary := []byte(traceContext[0]) - parent, haveParent = propagation.FromBinary(traceContextBinary) - if haveParent && !s.IsPublicEndpoint { - ctx, _ := trace.StartSpanWithRemoteParent(ctx, name, parent, - trace.WithSpanKind(trace.SpanKindServer), - trace.WithSampler(s.StartOptions.Sampler), - ) - return ctx - } - } - ctx, span := trace.StartSpan(ctx, name, - trace.WithSpanKind(trace.SpanKindServer), - trace.WithSampler(s.StartOptions.Sampler)) - if haveParent { - span.AddLink(trace.Link{TraceID: parent.TraceID, SpanID: parent.SpanID, Type: trace.LinkTypeChild}) - } - return ctx -} - -func traceHandleRPC(ctx context.Context, rs stats.RPCStats) { - span := trace.FromContext(ctx) - // TODO: compressed and uncompressed sizes are not populated in every message. - switch rs := rs.(type) { - case *stats.Begin: - span.AddAttributes( - trace.BoolAttribute("Client", rs.Client), - trace.BoolAttribute("FailFast", rs.FailFast)) - case *stats.InPayload: - span.AddMessageReceiveEvent(0 /* TODO: messageID */, int64(rs.Length), int64(rs.WireLength)) - case *stats.OutPayload: - span.AddMessageSendEvent(0, int64(rs.Length), int64(rs.WireLength)) - case *stats.End: - if rs.Error != nil { - s, ok := status.FromError(rs.Error) - if ok { - span.SetStatus(trace.Status{Code: int32(s.Code()), Message: s.Message()}) - } else { - span.SetStatus(trace.Status{Code: int32(codes.Internal), Message: rs.Error.Error()}) - } - } - span.End() - } -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/client.go b/vendor/go.opencensus.io/plugin/ochttp/client.go deleted file mode 100644 index da815b2a73451..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/client.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "net/http" - "net/http/httptrace" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// Transport is an http.RoundTripper that instruments all outgoing requests with -// OpenCensus stats and tracing. -// -// The zero value is intended to be a useful default, but for -// now it's recommended that you explicitly set Propagation, since the default -// for this may change. -type Transport struct { - // Base may be set to wrap another http.RoundTripper that does the actual - // requests. By default http.DefaultTransport is used. - // - // If base HTTP roundtripper implements CancelRequest, - // the returned round tripper will be cancelable. - Base http.RoundTripper - - // Propagation defines how traces are propagated. If unspecified, a default - // (currently B3 format) will be used. - Propagation propagation.HTTPFormat - - // StartOptions are applied to the span started by this Transport around each - // request. - // - // StartOptions.SpanKind will always be set to trace.SpanKindClient - // for spans started by this transport. - StartOptions trace.StartOptions - - // GetStartOptions allows to set start options per request. If set, - // StartOptions is going to be ignored. - GetStartOptions func(*http.Request) trace.StartOptions - - // NameFromRequest holds the function to use for generating the span name - // from the information found in the outgoing HTTP Request. By default the - // name equals the URL Path. - FormatSpanName func(*http.Request) string - - // NewClientTrace may be set to a function allowing the current *trace.Span - // to be annotated with HTTP request event information emitted by the - // httptrace package. - NewClientTrace func(*http.Request, *trace.Span) *httptrace.ClientTrace - - // TODO: Implement tag propagation for HTTP. -} - -// RoundTrip implements http.RoundTripper, delegating to Base and recording stats and traces for the request. -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - rt := t.base() - if isHealthEndpoint(req.URL.Path) { - return rt.RoundTrip(req) - } - // TODO: remove excessive nesting of http.RoundTrippers here. - format := t.Propagation - if format == nil { - format = defaultFormat - } - spanNameFormatter := t.FormatSpanName - if spanNameFormatter == nil { - spanNameFormatter = spanNameFromURL - } - - startOpts := t.StartOptions - if t.GetStartOptions != nil { - startOpts = t.GetStartOptions(req) - } - - rt = &traceTransport{ - base: rt, - format: format, - startOptions: trace.StartOptions{ - Sampler: startOpts.Sampler, - SpanKind: trace.SpanKindClient, - }, - formatSpanName: spanNameFormatter, - newClientTrace: t.NewClientTrace, - } - rt = statsTransport{base: rt} - return rt.RoundTrip(req) -} - -func (t *Transport) base() http.RoundTripper { - if t.Base != nil { - return t.Base - } - return http.DefaultTransport -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t *Transport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(*http.Request) - } - if cr, ok := t.base().(canceler); ok { - cr.CancelRequest(req) - } -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/client_stats.go b/vendor/go.opencensus.io/plugin/ochttp/client_stats.go deleted file mode 100644 index 17142aabe002a..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/client_stats.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "context" - "io" - "net/http" - "strconv" - "sync" - "time" - - "go.opencensus.io/stats" - "go.opencensus.io/tag" -) - -// statsTransport is an http.RoundTripper that collects stats for the outgoing requests. -type statsTransport struct { - base http.RoundTripper -} - -// RoundTrip implements http.RoundTripper, delegating to Base and recording stats for the request. -func (t statsTransport) RoundTrip(req *http.Request) (*http.Response, error) { - ctx, _ := tag.New(req.Context(), - tag.Upsert(KeyClientHost, req.Host), - tag.Upsert(Host, req.Host), - tag.Upsert(KeyClientPath, req.URL.Path), - tag.Upsert(Path, req.URL.Path), - tag.Upsert(KeyClientMethod, req.Method), - tag.Upsert(Method, req.Method)) - req = req.WithContext(ctx) - track := &tracker{ - start: time.Now(), - ctx: ctx, - } - if req.Body == nil { - // TODO: Handle cases where ContentLength is not set. - track.reqSize = -1 - } else if req.ContentLength > 0 { - track.reqSize = req.ContentLength - } - stats.Record(ctx, ClientRequestCount.M(1)) - - // Perform request. - resp, err := t.base.RoundTrip(req) - - if err != nil { - track.statusCode = http.StatusInternalServerError - track.end() - } else { - track.statusCode = resp.StatusCode - if req.Method != "HEAD" { - track.respContentLength = resp.ContentLength - } - if resp.Body == nil { - track.end() - } else { - track.body = resp.Body - resp.Body = wrappedBody(track, resp.Body) - } - } - return resp, err -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t statsTransport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(*http.Request) - } - if cr, ok := t.base.(canceler); ok { - cr.CancelRequest(req) - } -} - -type tracker struct { - ctx context.Context - respSize int64 - respContentLength int64 - reqSize int64 - start time.Time - body io.ReadCloser - statusCode int - endOnce sync.Once -} - -var _ io.ReadCloser = (*tracker)(nil) - -func (t *tracker) end() { - t.endOnce.Do(func() { - latencyMs := float64(time.Since(t.start)) / float64(time.Millisecond) - respSize := t.respSize - if t.respSize == 0 && t.respContentLength > 0 { - respSize = t.respContentLength - } - m := []stats.Measurement{ - ClientSentBytes.M(t.reqSize), - ClientReceivedBytes.M(respSize), - ClientRoundtripLatency.M(latencyMs), - ClientLatency.M(latencyMs), - ClientResponseBytes.M(t.respSize), - } - if t.reqSize >= 0 { - m = append(m, ClientRequestBytes.M(t.reqSize)) - } - - stats.RecordWithTags(t.ctx, []tag.Mutator{ - tag.Upsert(StatusCode, strconv.Itoa(t.statusCode)), - tag.Upsert(KeyClientStatus, strconv.Itoa(t.statusCode)), - }, m...) - }) -} - -func (t *tracker) Read(b []byte) (int, error) { - n, err := t.body.Read(b) - t.respSize += int64(n) - switch err { - case nil: - return n, nil - case io.EOF: - t.end() - } - return n, err -} - -func (t *tracker) Close() error { - // Invoking endSpan on Close will help catch the cases - // in which a read returned a non-nil error, we set the - // span status but didn't end the span. - t.end() - return t.body.Close() -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/doc.go b/vendor/go.opencensus.io/plugin/ochttp/doc.go deleted file mode 100644 index 10e626b16e610..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ochttp provides OpenCensus instrumentation for net/http package. -// -// For server instrumentation, see Handler. For client-side instrumentation, -// see Transport. -package ochttp // import "go.opencensus.io/plugin/ochttp" diff --git a/vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go b/vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go deleted file mode 100644 index 9ad8852198d5b..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/propagation/b3/b3.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package b3 contains a propagation.HTTPFormat implementation -// for B3 propagation. See https://github.com/openzipkin/b3-propagation -// for more details. -package b3 // import "go.opencensus.io/plugin/ochttp/propagation/b3" - -import ( - "encoding/hex" - "net/http" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// B3 headers that OpenCensus understands. -const ( - TraceIDHeader = "X-B3-TraceId" - SpanIDHeader = "X-B3-SpanId" - SampledHeader = "X-B3-Sampled" -) - -// HTTPFormat implements propagation.HTTPFormat to propagate -// traces in HTTP headers in B3 propagation format. -// HTTPFormat skips the X-B3-ParentId and X-B3-Flags headers -// because there are additional fields not represented in the -// OpenCensus span context. Spans created from the incoming -// header will be the direct children of the client-side span. -// Similarly, receiver of the outgoing spans should use client-side -// span created by OpenCensus as the parent. -type HTTPFormat struct{} - -var _ propagation.HTTPFormat = (*HTTPFormat)(nil) - -// SpanContextFromRequest extracts a B3 span context from incoming requests. -func (f *HTTPFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) { - tid, ok := ParseTraceID(req.Header.Get(TraceIDHeader)) - if !ok { - return trace.SpanContext{}, false - } - sid, ok := ParseSpanID(req.Header.Get(SpanIDHeader)) - if !ok { - return trace.SpanContext{}, false - } - sampled, _ := ParseSampled(req.Header.Get(SampledHeader)) - return trace.SpanContext{ - TraceID: tid, - SpanID: sid, - TraceOptions: sampled, - }, true -} - -// ParseTraceID parses the value of the X-B3-TraceId header. -func ParseTraceID(tid string) (trace.TraceID, bool) { - if tid == "" { - return trace.TraceID{}, false - } - b, err := hex.DecodeString(tid) - if err != nil || len(b) > 16 { - return trace.TraceID{}, false - } - var traceID trace.TraceID - if len(b) <= 8 { - // The lower 64-bits. - start := 8 + (8 - len(b)) - copy(traceID[start:], b) - } else { - start := 16 - len(b) - copy(traceID[start:], b) - } - - return traceID, true -} - -// ParseSpanID parses the value of the X-B3-SpanId or X-B3-ParentSpanId headers. -func ParseSpanID(sid string) (spanID trace.SpanID, ok bool) { - if sid == "" { - return trace.SpanID{}, false - } - b, err := hex.DecodeString(sid) - if err != nil || len(b) > 8 { - return trace.SpanID{}, false - } - start := 8 - len(b) - copy(spanID[start:], b) - return spanID, true -} - -// ParseSampled parses the value of the X-B3-Sampled header. -func ParseSampled(sampled string) (trace.TraceOptions, bool) { - switch sampled { - case "true", "1": - return trace.TraceOptions(1), true - default: - return trace.TraceOptions(0), false - } -} - -// SpanContextToRequest modifies the given request to include B3 headers. -func (f *HTTPFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { - req.Header.Set(TraceIDHeader, hex.EncodeToString(sc.TraceID[:])) - req.Header.Set(SpanIDHeader, hex.EncodeToString(sc.SpanID[:])) - - var sampled string - if sc.IsSampled() { - sampled = "1" - } else { - sampled = "0" - } - req.Header.Set(SampledHeader, sampled) -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/route.go b/vendor/go.opencensus.io/plugin/ochttp/route.go deleted file mode 100644 index 5e6a3430760b6..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/route.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "context" - "net/http" - - "go.opencensus.io/tag" -) - -// SetRoute sets the http_server_route tag to the given value. -// It's useful when an HTTP framework does not support the http.Handler interface -// and using WithRouteTag is not an option, but provides a way to hook into the request flow. -func SetRoute(ctx context.Context, route string) { - if a, ok := ctx.Value(addedTagsKey{}).(*addedTags); ok { - a.t = append(a.t, tag.Upsert(KeyServerRoute, route)) - } -} - -// WithRouteTag returns an http.Handler that records stats with the -// http_server_route tag set to the given value. -func WithRouteTag(handler http.Handler, route string) http.Handler { - return taggedHandlerFunc(func(w http.ResponseWriter, r *http.Request) []tag.Mutator { - addRoute := []tag.Mutator{tag.Upsert(KeyServerRoute, route)} - ctx, _ := tag.New(r.Context(), addRoute...) - r = r.WithContext(ctx) - handler.ServeHTTP(w, r) - return addRoute - }) -} - -// taggedHandlerFunc is a http.Handler that returns tags describing the -// processing of the request. These tags will be recorded along with the -// measures in this package at the end of the request. -type taggedHandlerFunc func(w http.ResponseWriter, r *http.Request) []tag.Mutator - -func (h taggedHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) { - tags := h(w, r) - if a, ok := r.Context().Value(addedTagsKey{}).(*addedTags); ok { - a.t = append(a.t, tags...) - } -} - -type addedTagsKey struct{} - -type addedTags struct { - t []tag.Mutator -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/server.go b/vendor/go.opencensus.io/plugin/ochttp/server.go deleted file mode 100644 index f7c8434be06cb..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/server.go +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "context" - "io" - "net/http" - "strconv" - "sync" - "time" - - "go.opencensus.io/stats" - "go.opencensus.io/tag" - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// Handler is an http.Handler wrapper to instrument your HTTP server with -// OpenCensus. It supports both stats and tracing. -// -// # Tracing -// -// This handler is aware of the incoming request's span, reading it from request -// headers as configured using the Propagation field. -// The extracted span can be accessed from the incoming request's -// context. -// -// span := trace.FromContext(r.Context()) -// -// The server span will be automatically ended at the end of ServeHTTP. -type Handler struct { - // Propagation defines how traces are propagated. If unspecified, - // B3 propagation will be used. - Propagation propagation.HTTPFormat - - // Handler is the handler used to handle the incoming request. - Handler http.Handler - - // StartOptions are applied to the span started by this Handler around each - // request. - // - // StartOptions.SpanKind will always be set to trace.SpanKindServer - // for spans started by this transport. - StartOptions trace.StartOptions - - // GetStartOptions allows to set start options per request. If set, - // StartOptions is going to be ignored. - GetStartOptions func(*http.Request) trace.StartOptions - - // IsPublicEndpoint should be set to true for publicly accessible HTTP(S) - // servers. If true, any trace metadata set on the incoming request will - // be added as a linked trace instead of being added as a parent of the - // current trace. - IsPublicEndpoint bool - - // FormatSpanName holds the function to use for generating the span name - // from the information found in the incoming HTTP Request. By default the - // name equals the URL Path. - FormatSpanName func(*http.Request) string - - // IsHealthEndpoint holds the function to use for determining if the - // incoming HTTP request should be considered a health check. This is in - // addition to the private isHealthEndpoint func which may also indicate - // tracing should be skipped. - IsHealthEndpoint func(*http.Request) bool -} - -func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - var tags addedTags - r, traceEnd := h.startTrace(w, r) - defer traceEnd() - w, statsEnd := h.startStats(w, r) - defer statsEnd(&tags) - handler := h.Handler - if handler == nil { - handler = http.DefaultServeMux - } - r = r.WithContext(context.WithValue(r.Context(), addedTagsKey{}, &tags)) - handler.ServeHTTP(w, r) -} - -func (h *Handler) startTrace(w http.ResponseWriter, r *http.Request) (*http.Request, func()) { - if h.IsHealthEndpoint != nil && h.IsHealthEndpoint(r) || isHealthEndpoint(r.URL.Path) { - return r, func() {} - } - var name string - if h.FormatSpanName == nil { - name = spanNameFromURL(r) - } else { - name = h.FormatSpanName(r) - } - ctx := r.Context() - - startOpts := h.StartOptions - if h.GetStartOptions != nil { - startOpts = h.GetStartOptions(r) - } - - var span *trace.Span - sc, ok := h.extractSpanContext(r) - if ok && !h.IsPublicEndpoint { - ctx, span = trace.StartSpanWithRemoteParent(ctx, name, sc, - trace.WithSampler(startOpts.Sampler), - trace.WithSpanKind(trace.SpanKindServer)) - } else { - ctx, span = trace.StartSpan(ctx, name, - trace.WithSampler(startOpts.Sampler), - trace.WithSpanKind(trace.SpanKindServer), - ) - if ok { - span.AddLink(trace.Link{ - TraceID: sc.TraceID, - SpanID: sc.SpanID, - Type: trace.LinkTypeParent, - Attributes: nil, - }) - } - } - span.AddAttributes(requestAttrs(r)...) - if r.Body == nil { - // TODO: Handle cases where ContentLength is not set. - } else if r.ContentLength > 0 { - span.AddMessageReceiveEvent(0, /* TODO: messageID */ - r.ContentLength, -1) - } - return r.WithContext(ctx), span.End -} - -func (h *Handler) extractSpanContext(r *http.Request) (trace.SpanContext, bool) { - if h.Propagation == nil { - return defaultFormat.SpanContextFromRequest(r) - } - return h.Propagation.SpanContextFromRequest(r) -} - -func (h *Handler) startStats(w http.ResponseWriter, r *http.Request) (http.ResponseWriter, func(tags *addedTags)) { - ctx, _ := tag.New(r.Context(), - tag.Upsert(Host, r.Host), - tag.Upsert(Path, r.URL.Path), - tag.Upsert(Method, r.Method)) - track := &trackingResponseWriter{ - start: time.Now(), - ctx: ctx, - writer: w, - } - if r.Body == nil { - // TODO: Handle cases where ContentLength is not set. - track.reqSize = -1 - } else if r.ContentLength > 0 { - track.reqSize = r.ContentLength - } - stats.Record(ctx, ServerRequestCount.M(1)) - return track.wrappedResponseWriter(), track.end -} - -type trackingResponseWriter struct { - ctx context.Context - reqSize int64 - respSize int64 - start time.Time - statusCode int - statusLine string - endOnce sync.Once - writer http.ResponseWriter -} - -// Compile time assertion for ResponseWriter interface -var _ http.ResponseWriter = (*trackingResponseWriter)(nil) - -func (t *trackingResponseWriter) end(tags *addedTags) { - t.endOnce.Do(func() { - if t.statusCode == 0 { - t.statusCode = 200 - } - - span := trace.FromContext(t.ctx) - span.SetStatus(TraceStatus(t.statusCode, t.statusLine)) - span.AddAttributes(trace.Int64Attribute(StatusCodeAttribute, int64(t.statusCode))) - - m := []stats.Measurement{ - ServerLatency.M(float64(time.Since(t.start)) / float64(time.Millisecond)), - ServerResponseBytes.M(t.respSize), - } - if t.reqSize >= 0 { - m = append(m, ServerRequestBytes.M(t.reqSize)) - } - allTags := make([]tag.Mutator, len(tags.t)+1) - allTags[0] = tag.Upsert(StatusCode, strconv.Itoa(t.statusCode)) - copy(allTags[1:], tags.t) - stats.RecordWithTags(t.ctx, allTags, m...) - }) -} - -func (t *trackingResponseWriter) Header() http.Header { - return t.writer.Header() -} - -func (t *trackingResponseWriter) Write(data []byte) (int, error) { - n, err := t.writer.Write(data) - t.respSize += int64(n) - // Add message event for request bytes sent. - span := trace.FromContext(t.ctx) - span.AddMessageSendEvent(0 /* TODO: messageID */, int64(n), -1) - return n, err -} - -func (t *trackingResponseWriter) WriteHeader(statusCode int) { - t.writer.WriteHeader(statusCode) - t.statusCode = statusCode - t.statusLine = http.StatusText(t.statusCode) -} - -// wrappedResponseWriter returns a wrapped version of the original -// -// ResponseWriter and only implements the same combination of additional -// -// interfaces as the original. -// This implementation is based on https://github.com/felixge/httpsnoop. -func (t *trackingResponseWriter) wrappedResponseWriter() http.ResponseWriter { - var ( - hj, i0 = t.writer.(http.Hijacker) - cn, i1 = t.writer.(http.CloseNotifier) - pu, i2 = t.writer.(http.Pusher) - fl, i3 = t.writer.(http.Flusher) - rf, i4 = t.writer.(io.ReaderFrom) - ) - - switch { - case !i0 && !i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - }{t} - case !i0 && !i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - io.ReaderFrom - }{t, rf} - case !i0 && !i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Flusher - }{t, fl} - case !i0 && !i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{t, fl, rf} - case !i0 && !i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Pusher - }{t, pu} - case !i0 && !i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Pusher - io.ReaderFrom - }{t, pu, rf} - case !i0 && !i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Pusher - http.Flusher - }{t, pu, fl} - case !i0 && !i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Pusher - http.Flusher - io.ReaderFrom - }{t, pu, fl, rf} - case !i0 && i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - }{t, cn} - case !i0 && i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{t, cn, rf} - case !i0 && i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Flusher - }{t, cn, fl} - case !i0 && i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Flusher - io.ReaderFrom - }{t, cn, fl, rf} - case !i0 && i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - }{t, cn, pu} - case !i0 && i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - io.ReaderFrom - }{t, cn, pu, rf} - case !i0 && i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - http.Flusher - }{t, cn, pu, fl} - case !i0 && i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.CloseNotifier - http.Pusher - http.Flusher - io.ReaderFrom - }{t, cn, pu, fl, rf} - case i0 && !i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - }{t, hj} - case i0 && !i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{t, hj, rf} - case i0 && !i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Flusher - }{t, hj, fl} - case i0 && !i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Flusher - io.ReaderFrom - }{t, hj, fl, rf} - case i0 && !i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - }{t, hj, pu} - case i0 && !i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - io.ReaderFrom - }{t, hj, pu, rf} - case i0 && !i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - http.Flusher - }{t, hj, pu, fl} - case i0 && !i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.Pusher - http.Flusher - io.ReaderFrom - }{t, hj, pu, fl, rf} - case i0 && i1 && !i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - }{t, hj, cn} - case i0 && i1 && !i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - io.ReaderFrom - }{t, hj, cn, rf} - case i0 && i1 && !i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Flusher - }{t, hj, cn, fl} - case i0 && i1 && !i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Flusher - io.ReaderFrom - }{t, hj, cn, fl, rf} - case i0 && i1 && i2 && !i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - }{t, hj, cn, pu} - case i0 && i1 && i2 && !i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - io.ReaderFrom - }{t, hj, cn, pu, rf} - case i0 && i1 && i2 && i3 && !i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - http.Flusher - }{t, hj, cn, pu, fl} - case i0 && i1 && i2 && i3 && i4: - return struct { - http.ResponseWriter - http.Hijacker - http.CloseNotifier - http.Pusher - http.Flusher - io.ReaderFrom - }{t, hj, cn, pu, fl, rf} - default: - return struct { - http.ResponseWriter - }{t} - } -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go b/vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go deleted file mode 100644 index 05c6c56cc790f..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/span_annotating_client_trace.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "crypto/tls" - "net/http" - "net/http/httptrace" - "strings" - - "go.opencensus.io/trace" -) - -type spanAnnotator struct { - sp *trace.Span -} - -// TODO: Remove NewSpanAnnotator at the next release. - -// NewSpanAnnotator returns a httptrace.ClientTrace which annotates -// all emitted httptrace events on the provided Span. -// Deprecated: Use NewSpanAnnotatingClientTrace instead -func NewSpanAnnotator(r *http.Request, s *trace.Span) *httptrace.ClientTrace { - return NewSpanAnnotatingClientTrace(r, s) -} - -// NewSpanAnnotatingClientTrace returns a httptrace.ClientTrace which annotates -// all emitted httptrace events on the provided Span. -func NewSpanAnnotatingClientTrace(_ *http.Request, s *trace.Span) *httptrace.ClientTrace { - sa := spanAnnotator{sp: s} - - return &httptrace.ClientTrace{ - GetConn: sa.getConn, - GotConn: sa.gotConn, - PutIdleConn: sa.putIdleConn, - GotFirstResponseByte: sa.gotFirstResponseByte, - Got100Continue: sa.got100Continue, - DNSStart: sa.dnsStart, - DNSDone: sa.dnsDone, - ConnectStart: sa.connectStart, - ConnectDone: sa.connectDone, - TLSHandshakeStart: sa.tlsHandshakeStart, - TLSHandshakeDone: sa.tlsHandshakeDone, - WroteHeaders: sa.wroteHeaders, - Wait100Continue: sa.wait100Continue, - WroteRequest: sa.wroteRequest, - } -} - -func (s spanAnnotator) getConn(hostPort string) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.get_connection.host_port", hostPort), - } - s.sp.Annotate(attrs, "GetConn") -} - -func (s spanAnnotator) gotConn(info httptrace.GotConnInfo) { - attrs := []trace.Attribute{ - trace.BoolAttribute("httptrace.got_connection.reused", info.Reused), - trace.BoolAttribute("httptrace.got_connection.was_idle", info.WasIdle), - } - if info.WasIdle { - attrs = append(attrs, - trace.StringAttribute("httptrace.got_connection.idle_time", info.IdleTime.String())) - } - s.sp.Annotate(attrs, "GotConn") -} - -// PutIdleConn implements a httptrace.ClientTrace hook -func (s spanAnnotator) putIdleConn(err error) { - var attrs []trace.Attribute - if err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.put_idle_connection.error", err.Error())) - } - s.sp.Annotate(attrs, "PutIdleConn") -} - -func (s spanAnnotator) gotFirstResponseByte() { - s.sp.Annotate(nil, "GotFirstResponseByte") -} - -func (s spanAnnotator) got100Continue() { - s.sp.Annotate(nil, "Got100Continue") -} - -func (s spanAnnotator) dnsStart(info httptrace.DNSStartInfo) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.dns_start.host", info.Host), - } - s.sp.Annotate(attrs, "DNSStart") -} - -func (s spanAnnotator) dnsDone(info httptrace.DNSDoneInfo) { - var addrs []string - for _, addr := range info.Addrs { - addrs = append(addrs, addr.String()) - } - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.dns_done.addrs", strings.Join(addrs, " , ")), - } - if info.Err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.dns_done.error", info.Err.Error())) - } - s.sp.Annotate(attrs, "DNSDone") -} - -func (s spanAnnotator) connectStart(network, addr string) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.connect_start.network", network), - trace.StringAttribute("httptrace.connect_start.addr", addr), - } - s.sp.Annotate(attrs, "ConnectStart") -} - -func (s spanAnnotator) connectDone(network, addr string, err error) { - attrs := []trace.Attribute{ - trace.StringAttribute("httptrace.connect_done.network", network), - trace.StringAttribute("httptrace.connect_done.addr", addr), - } - if err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.connect_done.error", err.Error())) - } - s.sp.Annotate(attrs, "ConnectDone") -} - -func (s spanAnnotator) tlsHandshakeStart() { - s.sp.Annotate(nil, "TLSHandshakeStart") -} - -func (s spanAnnotator) tlsHandshakeDone(_ tls.ConnectionState, err error) { - var attrs []trace.Attribute - if err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.tls_handshake_done.error", err.Error())) - } - s.sp.Annotate(attrs, "TLSHandshakeDone") -} - -func (s spanAnnotator) wroteHeaders() { - s.sp.Annotate(nil, "WroteHeaders") -} - -func (s spanAnnotator) wait100Continue() { - s.sp.Annotate(nil, "Wait100Continue") -} - -func (s spanAnnotator) wroteRequest(info httptrace.WroteRequestInfo) { - var attrs []trace.Attribute - if info.Err != nil { - attrs = append(attrs, - trace.StringAttribute("httptrace.wrote_request.error", info.Err.Error())) - } - s.sp.Annotate(attrs, "WroteRequest") -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/stats.go b/vendor/go.opencensus.io/plugin/ochttp/stats.go deleted file mode 100644 index ee3729040ddd5..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/stats.go +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "go.opencensus.io/stats" - "go.opencensus.io/stats/view" - "go.opencensus.io/tag" -) - -// Deprecated: client HTTP measures. -var ( - // Deprecated: Use a Count aggregation over one of the other client measures to achieve the same effect. - ClientRequestCount = stats.Int64( - "opencensus.io/http/client/request_count", - "Number of HTTP requests started", - stats.UnitDimensionless) - // Deprecated: Use ClientSentBytes. - ClientRequestBytes = stats.Int64( - "opencensus.io/http/client/request_bytes", - "HTTP request body size if set as ContentLength (uncompressed)", - stats.UnitBytes) - // Deprecated: Use ClientReceivedBytes. - ClientResponseBytes = stats.Int64( - "opencensus.io/http/client/response_bytes", - "HTTP response body size (uncompressed)", - stats.UnitBytes) - // Deprecated: Use ClientRoundtripLatency. - ClientLatency = stats.Float64( - "opencensus.io/http/client/latency", - "End-to-end latency", - stats.UnitMilliseconds) -) - -// The following client HTTP measures are supported for use in custom views. -var ( - ClientSentBytes = stats.Int64( - "opencensus.io/http/client/sent_bytes", - "Total bytes sent in request body (not including headers)", - stats.UnitBytes, - ) - ClientReceivedBytes = stats.Int64( - "opencensus.io/http/client/received_bytes", - "Total bytes received in response bodies (not including headers but including error responses with bodies)", - stats.UnitBytes, - ) - ClientRoundtripLatency = stats.Float64( - "opencensus.io/http/client/roundtrip_latency", - "Time between first byte of request headers sent to last byte of response received, or terminal error", - stats.UnitMilliseconds, - ) -) - -// The following server HTTP measures are supported for use in custom views: -var ( - ServerRequestCount = stats.Int64( - "opencensus.io/http/server/request_count", - "Number of HTTP requests started", - stats.UnitDimensionless) - ServerRequestBytes = stats.Int64( - "opencensus.io/http/server/request_bytes", - "HTTP request body size if set as ContentLength (uncompressed)", - stats.UnitBytes) - ServerResponseBytes = stats.Int64( - "opencensus.io/http/server/response_bytes", - "HTTP response body size (uncompressed)", - stats.UnitBytes) - ServerLatency = stats.Float64( - "opencensus.io/http/server/latency", - "End-to-end latency", - stats.UnitMilliseconds) -) - -// The following tags are applied to stats recorded by this package. Host, Path -// and Method are applied to all measures. StatusCode is not applied to -// ClientRequestCount or ServerRequestCount, since it is recorded before the status is known. -var ( - // Host is the value of the HTTP Host header. - // - // The value of this tag can be controlled by the HTTP client, so you need - // to watch out for potentially generating high-cardinality labels in your - // metrics backend if you use this tag in views. - Host = tag.MustNewKey("http.host") - - // StatusCode is the numeric HTTP response status code, - // or "error" if a transport error occurred and no status code was read. - StatusCode = tag.MustNewKey("http.status") - - // Path is the URL path (not including query string) in the request. - // - // The value of this tag can be controlled by the HTTP client, so you need - // to watch out for potentially generating high-cardinality labels in your - // metrics backend if you use this tag in views. - Path = tag.MustNewKey("http.path") - - // Method is the HTTP method of the request, capitalized (GET, POST, etc.). - Method = tag.MustNewKey("http.method") - - // KeyServerRoute is a low cardinality string representing the logical - // handler of the request. This is usually the pattern registered on the a - // ServeMux (or similar string). - KeyServerRoute = tag.MustNewKey("http_server_route") -) - -// Client tag keys. -var ( - // KeyClientMethod is the HTTP method, capitalized (i.e. GET, POST, PUT, DELETE, etc.). - KeyClientMethod = tag.MustNewKey("http_client_method") - // KeyClientPath is the URL path (not including query string). - KeyClientPath = tag.MustNewKey("http_client_path") - // KeyClientStatus is the HTTP status code as an integer (e.g. 200, 404, 500.), or "error" if no response status line was received. - KeyClientStatus = tag.MustNewKey("http_client_status") - // KeyClientHost is the value of the request Host header. - KeyClientHost = tag.MustNewKey("http_client_host") -) - -// Default distributions used by views in this package. -var ( - DefaultSizeDistribution = view.Distribution(1024, 2048, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216, 67108864, 268435456, 1073741824, 4294967296) - DefaultLatencyDistribution = view.Distribution(1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 25, 30, 40, 50, 65, 80, 100, 130, 160, 200, 250, 300, 400, 500, 650, 800, 1000, 2000, 5000, 10000, 20000, 50000, 100000) -) - -// Package ochttp provides some convenience views for client measures. -// You still need to register these views for data to actually be collected. -var ( - ClientSentBytesDistribution = &view.View{ - Name: "opencensus.io/http/client/sent_bytes", - Measure: ClientSentBytes, - Aggregation: DefaultSizeDistribution, - Description: "Total bytes sent in request body (not including headers), by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } - - ClientReceivedBytesDistribution = &view.View{ - Name: "opencensus.io/http/client/received_bytes", - Measure: ClientReceivedBytes, - Aggregation: DefaultSizeDistribution, - Description: "Total bytes received in response bodies (not including headers but including error responses with bodies), by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } - - ClientRoundtripLatencyDistribution = &view.View{ - Name: "opencensus.io/http/client/roundtrip_latency", - Measure: ClientRoundtripLatency, - Aggregation: DefaultLatencyDistribution, - Description: "End-to-end latency, by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } - - ClientCompletedCount = &view.View{ - Name: "opencensus.io/http/client/completed_count", - Measure: ClientRoundtripLatency, - Aggregation: view.Count(), - Description: "Count of completed requests, by HTTP method and response status", - TagKeys: []tag.Key{KeyClientMethod, KeyClientStatus}, - } -) - -// Deprecated: Old client Views. -var ( - // Deprecated: No direct replacement, but see ClientCompletedCount. - ClientRequestCountView = &view.View{ - Name: "opencensus.io/http/client/request_count", - Description: "Count of HTTP requests started", - Measure: ClientRequestCount, - Aggregation: view.Count(), - } - - // Deprecated: Use ClientSentBytesDistribution. - ClientRequestBytesView = &view.View{ - Name: "opencensus.io/http/client/request_bytes", - Description: "Size distribution of HTTP request body", - Measure: ClientSentBytes, - Aggregation: DefaultSizeDistribution, - } - - // Deprecated: Use ClientReceivedBytesDistribution instead. - ClientResponseBytesView = &view.View{ - Name: "opencensus.io/http/client/response_bytes", - Description: "Size distribution of HTTP response body", - Measure: ClientReceivedBytes, - Aggregation: DefaultSizeDistribution, - } - - // Deprecated: Use ClientRoundtripLatencyDistribution instead. - ClientLatencyView = &view.View{ - Name: "opencensus.io/http/client/latency", - Description: "Latency distribution of HTTP requests", - Measure: ClientRoundtripLatency, - Aggregation: DefaultLatencyDistribution, - } - - // Deprecated: Use ClientCompletedCount instead. - ClientRequestCountByMethod = &view.View{ - Name: "opencensus.io/http/client/request_count_by_method", - Description: "Client request count by HTTP method", - TagKeys: []tag.Key{Method}, - Measure: ClientSentBytes, - Aggregation: view.Count(), - } - - // Deprecated: Use ClientCompletedCount instead. - ClientResponseCountByStatusCode = &view.View{ - Name: "opencensus.io/http/client/response_count_by_status_code", - Description: "Client response count by status code", - TagKeys: []tag.Key{StatusCode}, - Measure: ClientRoundtripLatency, - Aggregation: view.Count(), - } -) - -// Package ochttp provides some convenience views for server measures. -// You still need to register these views for data to actually be collected. -var ( - ServerRequestCountView = &view.View{ - Name: "opencensus.io/http/server/request_count", - Description: "Count of HTTP requests started", - Measure: ServerRequestCount, - Aggregation: view.Count(), - } - - ServerRequestBytesView = &view.View{ - Name: "opencensus.io/http/server/request_bytes", - Description: "Size distribution of HTTP request body", - Measure: ServerRequestBytes, - Aggregation: DefaultSizeDistribution, - } - - ServerResponseBytesView = &view.View{ - Name: "opencensus.io/http/server/response_bytes", - Description: "Size distribution of HTTP response body", - Measure: ServerResponseBytes, - Aggregation: DefaultSizeDistribution, - } - - ServerLatencyView = &view.View{ - Name: "opencensus.io/http/server/latency", - Description: "Latency distribution of HTTP requests", - Measure: ServerLatency, - Aggregation: DefaultLatencyDistribution, - } - - ServerRequestCountByMethod = &view.View{ - Name: "opencensus.io/http/server/request_count_by_method", - Description: "Server request count by HTTP method", - TagKeys: []tag.Key{Method}, - Measure: ServerRequestCount, - Aggregation: view.Count(), - } - - ServerResponseCountByStatusCode = &view.View{ - Name: "opencensus.io/http/server/response_count_by_status_code", - Description: "Server response count by status code", - TagKeys: []tag.Key{StatusCode}, - Measure: ServerLatency, - Aggregation: view.Count(), - } -) - -// DefaultClientViews are the default client views provided by this package. -// Deprecated: No replacement. Register the views you would like individually. -var DefaultClientViews = []*view.View{ - ClientRequestCountView, - ClientRequestBytesView, - ClientResponseBytesView, - ClientLatencyView, - ClientRequestCountByMethod, - ClientResponseCountByStatusCode, -} - -// DefaultServerViews are the default server views provided by this package. -// Deprecated: No replacement. Register the views you would like individually. -var DefaultServerViews = []*view.View{ - ServerRequestCountView, - ServerRequestBytesView, - ServerResponseBytesView, - ServerLatencyView, - ServerRequestCountByMethod, - ServerResponseCountByStatusCode, -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/trace.go b/vendor/go.opencensus.io/plugin/ochttp/trace.go deleted file mode 100644 index ed3a5db561134..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/trace.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2018, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "io" - "net/http" - "net/http/httptrace" - - "go.opencensus.io/plugin/ochttp/propagation/b3" - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -// TODO(jbd): Add godoc examples. - -var defaultFormat propagation.HTTPFormat = &b3.HTTPFormat{} - -// Attributes recorded on the span for the requests. -// Only trace exporters will need them. -const ( - HostAttribute = "http.host" - MethodAttribute = "http.method" - PathAttribute = "http.path" - URLAttribute = "http.url" - UserAgentAttribute = "http.user_agent" - StatusCodeAttribute = "http.status_code" -) - -type traceTransport struct { - base http.RoundTripper - startOptions trace.StartOptions - format propagation.HTTPFormat - formatSpanName func(*http.Request) string - newClientTrace func(*http.Request, *trace.Span) *httptrace.ClientTrace -} - -// TODO(jbd): Add message events for request and response size. - -// RoundTrip creates a trace.Span and inserts it into the outgoing request's headers. -// The created span can follow a parent span, if a parent is presented in -// the request's context. -func (t *traceTransport) RoundTrip(req *http.Request) (*http.Response, error) { - name := t.formatSpanName(req) - // TODO(jbd): Discuss whether we want to prefix - // outgoing requests with Sent. - ctx, span := trace.StartSpan(req.Context(), name, - trace.WithSampler(t.startOptions.Sampler), - trace.WithSpanKind(trace.SpanKindClient)) - - if t.newClientTrace != nil { - req = req.WithContext(httptrace.WithClientTrace(ctx, t.newClientTrace(req, span))) - } else { - req = req.WithContext(ctx) - } - - if t.format != nil { - // SpanContextToRequest will modify its Request argument, which is - // contrary to the contract for http.RoundTripper, so we need to - // pass it a copy of the Request. - // However, the Request struct itself was already copied by - // the WithContext calls above and so we just need to copy the header. - header := make(http.Header) - for k, v := range req.Header { - header[k] = v - } - req.Header = header - t.format.SpanContextToRequest(span.SpanContext(), req) - } - - span.AddAttributes(requestAttrs(req)...) - resp, err := t.base.RoundTrip(req) - if err != nil { - span.SetStatus(trace.Status{Code: trace.StatusCodeUnknown, Message: err.Error()}) - span.End() - return resp, err - } - - span.AddAttributes(responseAttrs(resp)...) - span.SetStatus(TraceStatus(resp.StatusCode, resp.Status)) - - // span.End() will be invoked after - // a read from resp.Body returns io.EOF or when - // resp.Body.Close() is invoked. - bt := &bodyTracker{rc: resp.Body, span: span} - resp.Body = wrappedBody(bt, resp.Body) - return resp, err -} - -// bodyTracker wraps a response.Body and invokes -// trace.EndSpan on encountering io.EOF on reading -// the body of the original response. -type bodyTracker struct { - rc io.ReadCloser - span *trace.Span -} - -var _ io.ReadCloser = (*bodyTracker)(nil) - -func (bt *bodyTracker) Read(b []byte) (int, error) { - n, err := bt.rc.Read(b) - - switch err { - case nil: - return n, nil - case io.EOF: - bt.span.End() - default: - // For all other errors, set the span status - bt.span.SetStatus(trace.Status{ - // Code 2 is the error code for Internal server error. - Code: 2, - Message: err.Error(), - }) - } - return n, err -} - -func (bt *bodyTracker) Close() error { - // Invoking endSpan on Close will help catch the cases - // in which a read returned a non-nil error, we set the - // span status but didn't end the span. - bt.span.End() - return bt.rc.Close() -} - -// CancelRequest cancels an in-flight request by closing its connection. -func (t *traceTransport) CancelRequest(req *http.Request) { - type canceler interface { - CancelRequest(*http.Request) - } - if cr, ok := t.base.(canceler); ok { - cr.CancelRequest(req) - } -} - -func spanNameFromURL(req *http.Request) string { - return req.URL.Path -} - -func requestAttrs(r *http.Request) []trace.Attribute { - userAgent := r.UserAgent() - - attrs := make([]trace.Attribute, 0, 5) - attrs = append(attrs, - trace.StringAttribute(PathAttribute, r.URL.Path), - trace.StringAttribute(URLAttribute, r.URL.String()), - trace.StringAttribute(HostAttribute, r.Host), - trace.StringAttribute(MethodAttribute, r.Method), - ) - - if userAgent != "" { - attrs = append(attrs, trace.StringAttribute(UserAgentAttribute, userAgent)) - } - - return attrs -} - -func responseAttrs(resp *http.Response) []trace.Attribute { - return []trace.Attribute{ - trace.Int64Attribute(StatusCodeAttribute, int64(resp.StatusCode)), - } -} - -// TraceStatus is a utility to convert the HTTP status code to a trace.Status that -// represents the outcome as closely as possible. -func TraceStatus(httpStatusCode int, statusLine string) trace.Status { - var code int32 - if httpStatusCode < 200 || httpStatusCode >= 400 { - code = trace.StatusCodeUnknown - } - switch httpStatusCode { - case 499: - code = trace.StatusCodeCancelled - case http.StatusBadRequest: - code = trace.StatusCodeInvalidArgument - case http.StatusUnprocessableEntity: - code = trace.StatusCodeInvalidArgument - case http.StatusGatewayTimeout: - code = trace.StatusCodeDeadlineExceeded - case http.StatusNotFound: - code = trace.StatusCodeNotFound - case http.StatusForbidden: - code = trace.StatusCodePermissionDenied - case http.StatusUnauthorized: // 401 is actually unauthenticated. - code = trace.StatusCodeUnauthenticated - case http.StatusTooManyRequests: - code = trace.StatusCodeResourceExhausted - case http.StatusNotImplemented: - code = trace.StatusCodeUnimplemented - case http.StatusServiceUnavailable: - code = trace.StatusCodeUnavailable - case http.StatusOK: - code = trace.StatusCodeOK - case http.StatusConflict: - code = trace.StatusCodeAlreadyExists - } - - return trace.Status{Code: code, Message: codeToStr[code]} -} - -var codeToStr = map[int32]string{ - trace.StatusCodeOK: `OK`, - trace.StatusCodeCancelled: `CANCELLED`, - trace.StatusCodeUnknown: `UNKNOWN`, - trace.StatusCodeInvalidArgument: `INVALID_ARGUMENT`, - trace.StatusCodeDeadlineExceeded: `DEADLINE_EXCEEDED`, - trace.StatusCodeNotFound: `NOT_FOUND`, - trace.StatusCodeAlreadyExists: `ALREADY_EXISTS`, - trace.StatusCodePermissionDenied: `PERMISSION_DENIED`, - trace.StatusCodeResourceExhausted: `RESOURCE_EXHAUSTED`, - trace.StatusCodeFailedPrecondition: `FAILED_PRECONDITION`, - trace.StatusCodeAborted: `ABORTED`, - trace.StatusCodeOutOfRange: `OUT_OF_RANGE`, - trace.StatusCodeUnimplemented: `UNIMPLEMENTED`, - trace.StatusCodeInternal: `INTERNAL`, - trace.StatusCodeUnavailable: `UNAVAILABLE`, - trace.StatusCodeDataLoss: `DATA_LOSS`, - trace.StatusCodeUnauthenticated: `UNAUTHENTICATED`, -} - -func isHealthEndpoint(path string) bool { - // Health checking is pretty frequent and - // traces collected for health endpoints - // can be extremely noisy and expensive. - // Disable canonical health checking endpoints - // like /healthz and /_ah/health for now. - if path == "/healthz" || path == "/_ah/health" { - return true - } - return false -} diff --git a/vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go b/vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go deleted file mode 100644 index 7d75cae2b1853..0000000000000 --- a/vendor/go.opencensus.io/plugin/ochttp/wrapped_body.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2019, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ochttp - -import ( - "io" -) - -// wrappedBody returns a wrapped version of the original -// Body and only implements the same combination of additional -// interfaces as the original. -func wrappedBody(wrapper io.ReadCloser, body io.ReadCloser) io.ReadCloser { - var ( - wr, i0 = body.(io.Writer) - ) - switch { - case !i0: - return struct { - io.ReadCloser - }{wrapper} - - case i0: - return struct { - io.ReadCloser - io.Writer - }{wrapper, wr} - default: - return struct { - io.ReadCloser - }{wrapper} - } -} diff --git a/vendor/go.opencensus.io/trace/propagation/propagation.go b/vendor/go.opencensus.io/trace/propagation/propagation.go deleted file mode 100644 index 1eb190a96a3a8..0000000000000 --- a/vendor/go.opencensus.io/trace/propagation/propagation.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package propagation implements the binary trace context format. -package propagation // import "go.opencensus.io/trace/propagation" - -// TODO: link to external spec document. - -// BinaryFormat format: -// -// Binary value: -// version_id: 1 byte representing the version id. -// -// For version_id = 0: -// -// version_format: -// field_format: -// -// Fields: -// -// TraceId: (field_id = 0, len = 16, default = "0000000000000000") - 16-byte array representing the trace_id. -// SpanId: (field_id = 1, len = 8, default = "00000000") - 8-byte array representing the span_id. -// TraceOptions: (field_id = 2, len = 1, default = "0") - 1-byte array representing the trace_options. -// -// Fields MUST be encoded using the field id order (smaller to higher). -// -// Valid value example: -// -// {0, 0, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 1, 97, -// 98, 99, 100, 101, 102, 103, 104, 2, 1} -// -// version_id = 0; -// trace_id = {64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79} -// span_id = {97, 98, 99, 100, 101, 102, 103, 104}; -// trace_options = {1}; - -import ( - "net/http" - - "go.opencensus.io/trace" -) - -// Binary returns the binary format representation of a SpanContext. -// -// If sc is the zero value, Binary returns nil. -func Binary(sc trace.SpanContext) []byte { - if sc == (trace.SpanContext{}) { - return nil - } - var b [29]byte - copy(b[2:18], sc.TraceID[:]) - b[18] = 1 - copy(b[19:27], sc.SpanID[:]) - b[27] = 2 - b[28] = uint8(sc.TraceOptions) - return b[:] -} - -// FromBinary returns the SpanContext represented by b. -// -// If b has an unsupported version ID or contains no TraceID, FromBinary -// returns with ok==false. -func FromBinary(b []byte) (sc trace.SpanContext, ok bool) { - if len(b) == 0 || b[0] != 0 { - return trace.SpanContext{}, false - } - b = b[1:] - if len(b) >= 17 && b[0] == 0 { - copy(sc.TraceID[:], b[1:17]) - b = b[17:] - } else { - return trace.SpanContext{}, false - } - if len(b) >= 9 && b[0] == 1 { - copy(sc.SpanID[:], b[1:9]) - b = b[9:] - } - if len(b) >= 2 && b[0] == 2 { - sc.TraceOptions = trace.TraceOptions(b[1]) - } - return sc, true -} - -// HTTPFormat implementations propagate span contexts -// in HTTP requests. -// -// SpanContextFromRequest extracts a span context from incoming -// requests. -// -// SpanContextToRequest modifies the given request to include the given -// span context. -type HTTPFormat interface { - SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) - SpanContextToRequest(sc trace.SpanContext, req *http.Request) -} - -// TODO(jbd): Find a more representative but short name for HTTPFormat. diff --git a/vendor/google.golang.org/api/compute/v1/compute-api.json b/vendor/google.golang.org/api/compute/v1/compute-api.json index 8fe8c383d7b99..68e261dfc8ab1 100644 --- a/vendor/google.golang.org/api/compute/v1/compute-api.json +++ b/vendor/google.golang.org/api/compute/v1/compute-api.json @@ -8683,6 +8683,54 @@ "https://www.googleapis.com/auth/compute" ] }, + "resumeInstances": { + "description": "Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resumeInstances", + "httpMethod": "POST", + "id": "compute.instanceGroupManagers.resumeInstances", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resumeInstances", + "request": { + "$ref": "InstanceGroupManagersResumeInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "setInstanceTemplate": { "description": "Specifies the instance template to use when creating new instances in this group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.", "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", @@ -8779,6 +8827,150 @@ "https://www.googleapis.com/auth/compute" ] }, + "startInstances": { + "description": "Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/startInstances", + "httpMethod": "POST", + "id": "compute.instanceGroupManagers.startInstances", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/startInstances", + "request": { + "$ref": "InstanceGroupManagersStartInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "stopInstances": { + "description": "Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/stopInstances", + "httpMethod": "POST", + "id": "compute.instanceGroupManagers.stopInstances", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/stopInstances", + "request": { + "$ref": "InstanceGroupManagersStopInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "suspendInstances": { + "description": "Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/suspendInstances", + "httpMethod": "POST", + "id": "compute.instanceGroupManagers.suspendInstances", + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "zone": { + "description": "The name of the zone where the managed instance group is located.", + "location": "path", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/suspendInstances", + "request": { + "$ref": "InstanceGroupManagersSuspendInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "updatePerInstanceConfigs": { "description": "Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.", "flatPath": "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs", @@ -10446,7 +10638,7 @@ "type": "string" }, "start": { - "description": "Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console.", + "description": "Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`. If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value. You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console. Note that the negative start is bounded by the retained buffer size, and the returned serial console output will not exceed the max buffer size.", "format": "int64", "location": "query", "type": "string" @@ -16276,6 +16468,100 @@ } } }, + "networkProfiles": { + "methods": { + "get": { + "description": "Returns the specified network profile.", + "flatPath": "projects/{project}/global/networkProfiles/{networkProfile}", + "httpMethod": "GET", + "id": "compute.networkProfiles.get", + "parameterOrder": [ + "project", + "networkProfile" + ], + "parameters": { + "networkProfile": { + "description": "Name of the network profile to return.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/global/networkProfiles/{networkProfile}", + "response": { + "$ref": "NetworkProfile" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "list": { + "description": "Retrieves a list of network profiles available to the specified project.", + "flatPath": "projects/{project}/global/networkProfiles", + "httpMethod": "GET", + "id": "compute.networkProfiles.list", + "parameterOrder": [ + "project" + ], + "parameters": { + "filter": { + "description": "A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `\u003e`, `\u003c`, `\u003c=`, `\u003e=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq \"double quoted literal\"` `(fieldname1 eq literal) (fieldname2 ne \"literal\")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name \"instance\", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.", + "location": "query", + "type": "string" + }, + "maxResults": { + "default": "500", + "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", + "format": "uint32", + "location": "query", + "minimum": "0", + "type": "integer" + }, + "orderBy": { + "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", + "location": "query", + "type": "string" + }, + "pageToken": { + "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", + "location": "query", + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "returnPartialSuccess": { + "description": "Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.", + "location": "query", + "type": "boolean" + } + }, + "path": "projects/{project}/global/networkProfiles", + "response": { + "$ref": "NetworkProfilesListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "networks": { "methods": { "addPeering": { @@ -23178,11 +23464,11 @@ "https://www.googleapis.com/auth/compute" ] }, - "setInstanceTemplate": { - "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.", - "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "resumeInstances": { + "description": "Flags the specified instances in the managed instance group to be resumed. This method increases the targetSize and decreases the targetSuspendedSize of the managed instance group by the number of instances that you resume. The resumeInstances operation is marked DONE if the resumeInstances request is successful. The underlying actions take additional time. You must separately verify the status of the RESUMING action with the listmanagedinstances method. In this request, you can only specify instances that are suspended. For example, if an instance was previously suspended using the suspendInstances method, it can be resumed using the resumeInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are resumed. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resumeInstances", "httpMethod": "POST", - "id": "compute.regionInstanceGroupManagers.setInstanceTemplate", + "id": "compute.regionInstanceGroupManagers.resumeInstances", "parameterOrder": [ "project", "region", @@ -23190,7 +23476,7 @@ ], "parameters": { "instanceGroupManager": { - "description": "The name of the managed instance group.", + "description": "Name of the managed instance group.", "location": "path", "required": true, "type": "string" @@ -23214,9 +23500,9 @@ "type": "string" } }, - "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resumeInstances", "request": { - "$ref": "RegionInstanceGroupManagersSetTemplateRequest" + "$ref": "RegionInstanceGroupManagersResumeInstancesRequest" }, "response": { "$ref": "Operation" @@ -23226,11 +23512,11 @@ "https://www.googleapis.com/auth/compute" ] }, - "setTargetPools": { - "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.", - "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "setInstanceTemplate": { + "description": "Sets the instance template to use when creating new instances or recreating instances in this group. Existing instances are not affected.", + "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", "httpMethod": "POST", - "id": "compute.regionInstanceGroupManagers.setTargetPools", + "id": "compute.regionInstanceGroupManagers.setInstanceTemplate", "parameterOrder": [ "project", "region", @@ -23238,7 +23524,55 @@ ], "parameters": { "instanceGroupManager": { - "description": "Name of the managed instance group.", + "description": "The name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "request": { + "$ref": "RegionInstanceGroupManagersSetTemplateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setTargetPools": { + "description": "Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.", + "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "httpMethod": "POST", + "id": "compute.regionInstanceGroupManagers.setTargetPools", + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "Name of the managed instance group.", "location": "path", "required": true, "type": "string" @@ -23274,6 +23608,150 @@ "https://www.googleapis.com/auth/compute" ] }, + "startInstances": { + "description": "Flags the specified instances in the managed instance group to be started. This method increases the targetSize and decreases the targetStoppedSize of the managed instance group by the number of instances that you start. The startInstances operation is marked DONE if the startInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STARTING action with the listmanagedinstances method. In this request, you can only specify instances that are stopped. For example, if an instance was previously stopped using the stopInstances method, it can be started using the startInstances method. If a health check is attached to the managed instance group, the specified instances will be verified as healthy after they are started. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/startInstances", + "httpMethod": "POST", + "id": "compute.regionInstanceGroupManagers.startInstances", + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "Name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/startInstances", + "request": { + "$ref": "RegionInstanceGroupManagersStartInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "stopInstances": { + "description": "Flags the specified instances in the managed instance group to be immediately stopped. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetStoppedSize of the managed instance group by the number of instances that you stop. The stopInstances operation is marked DONE if the stopInstances request is successful. The underlying actions take additional time. You must separately verify the status of the STOPPING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays stopping the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is stopped. Stopped instances can be started using the startInstances method. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/stopInstances", + "httpMethod": "POST", + "id": "compute.regionInstanceGroupManagers.stopInstances", + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "The name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/stopInstances", + "request": { + "$ref": "RegionInstanceGroupManagersStopInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "suspendInstances": { + "description": "Flags the specified instances in the managed instance group to be immediately suspended. You can only specify instances that are running in this request. This method reduces the targetSize and increases the targetSuspendedSize of the managed instance group by the number of instances that you suspend. The suspendInstances operation is marked DONE if the suspendInstances request is successful. The underlying actions take additional time. You must separately verify the status of the SUSPENDING action with the listmanagedinstances method. If the standbyPolicy.initialDelaySec field is set, the group delays suspension of the instances until initialDelaySec have passed from instance.creationTimestamp (that is, when the instance was created). This delay gives your application time to set itself up and initialize on the instance. If more than initialDelaySec seconds have passed since instance.creationTimestamp when this method is called, there will be zero delay. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration has elapsed before the VM instance is suspended. Suspended instances can be resumed using the resumeInstances method. You can specify a maximum of 1000 instances with this method per request.", + "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/suspendInstances", + "httpMethod": "POST", + "id": "compute.regionInstanceGroupManagers.suspendInstances", + "parameterOrder": [ + "project", + "region", + "instanceGroupManager" + ], + "parameters": { + "instanceGroupManager": { + "description": "Name of the managed instance group.", + "location": "path", + "required": true, + "type": "string" + }, + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "Name of the region scoping this request.", + "location": "path", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/suspendInstances", + "request": { + "$ref": "RegionInstanceGroupManagersSuspendInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, "updatePerInstanceConfigs": { "description": "Inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.", "flatPath": "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs", @@ -26258,6 +26736,56 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/compute" ] + }, + "setLabels": { + "description": "Sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.", + "flatPath": "projects/{project}/regions/{region}/securityPolicies/{resource}/setLabels", + "httpMethod": "POST", + "id": "compute.regionSecurityPolicies.setLabels", + "parameterOrder": [ + "project", + "region", + "resource" + ], + "parameters": { + "project": { + "description": "Project ID for this request.", + "location": "path", + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "required": true, + "type": "string" + }, + "region": { + "description": "The region for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "required": true, + "type": "string" + }, + "requestId": { + "description": "An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).", + "location": "query", + "type": "string" + }, + "resource": { + "description": "Name or id of the resource for this request.", + "location": "path", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", + "required": true, + "type": "string" + } + }, + "path": "projects/{project}/regions/{region}/securityPolicies/{resource}/setLabels", + "request": { + "$ref": "RegionSetLabelsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] } } }, @@ -37421,7 +37949,7 @@ } } }, - "revision": "20241105", + "revision": "20241201", "rootUrl": "https://compute.googleapis.com/", "schemas": { "AWSV4Signature": { @@ -37572,6 +38100,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -37608,6 +38137,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -37632,6 +38162,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -37724,6 +38255,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -37760,6 +38292,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -37784,6 +38317,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -37858,6 +38392,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -37894,6 +38429,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -37918,6 +38454,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -38259,6 +38796,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -38295,6 +38833,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -38319,6 +38858,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -38411,6 +38951,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -38447,6 +38988,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -38471,6 +39013,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -38545,6 +39088,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -38581,6 +39125,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -38605,6 +39150,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -39339,6 +39885,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -39375,6 +39922,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -39399,6 +39947,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -39491,6 +40040,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -39527,6 +40077,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -39551,6 +40102,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -39683,6 +40235,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -39719,6 +40272,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -39743,6 +40297,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -40146,7 +40701,7 @@ "description": "The CacheKeyPolicy for this CdnPolicy." }, "cacheMode": { - "description": "Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any \"private\", \"no-store\" or \"no-cache\" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached.", + "description": "Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any \"private\", \"no-store\" or \"no-cache\" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC.", "enum": [ "CACHE_ALL_STATIC", "FORCE_CACHE_ALL", @@ -40315,6 +40870,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -40351,6 +40907,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -40375,6 +40932,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -40795,6 +41353,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -40831,6 +41390,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -40855,6 +41415,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -40908,7 +41469,7 @@ "description": "The CacheKeyPolicy for this CdnPolicy." }, "cacheMode": { - "description": "Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any \"private\", \"no-store\" or \"no-cache\" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached.", + "description": "Specifies the cache setting for all responses from this backend. The possible values are: USE_ORIGIN_HEADERS Requires the origin to set valid caching headers to cache content. Responses without these headers will not be cached at Google's edge, and will require a full trip to the origin on every request, potentially impacting performance and increasing load on the origin server. FORCE_CACHE_ALL Cache all content, ignoring any \"private\", \"no-store\" or \"no-cache\" directives in Cache-Control response headers. Warning: this may result in Cloud CDN caching private, per-user (user identifiable) content. CACHE_ALL_STATIC Automatically cache static content, including common image formats, media (video and audio), and web assets (JavaScript and CSS). Requests and responses that are marked as uncacheable, as well as dynamic content (including HTML), will not be cached. If no value is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC.", "enum": [ "CACHE_ALL_STATIC", "FORCE_CACHE_ALL", @@ -41187,6 +41748,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -41223,6 +41785,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -41247,6 +41810,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -41339,6 +41903,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -41375,6 +41940,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -41399,6 +41965,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -41588,6 +42155,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -41624,6 +42192,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -41648,6 +42217,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -42313,6 +42883,9 @@ "GRAPHICS_OPTIMIZED", "MEMORY_OPTIMIZED", "MEMORY_OPTIMIZED_M3", + "MEMORY_OPTIMIZED_X4_16TB", + "MEMORY_OPTIMIZED_X4_24TB", + "MEMORY_OPTIMIZED_X4_32TB", "STORAGE_OPTIMIZED_Z3", "TYPE_UNSPECIFIED" ], @@ -42337,6 +42910,9 @@ "", "", "", + "", + "", + "", "" ], "type": "string" @@ -42406,6 +42982,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -42442,6 +43019,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -42466,6 +43044,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -42558,6 +43137,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -42594,6 +43174,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -42618,6 +43199,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -42703,6 +43285,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -42739,6 +43322,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -42763,6 +43347,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -43397,6 +43982,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -43433,6 +44019,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -43457,6 +44044,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -43621,6 +44209,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -43657,6 +44246,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -43681,6 +44271,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -43904,6 +44495,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -43940,6 +44532,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -43964,6 +44557,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -44056,6 +44650,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -44092,6 +44687,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -44116,6 +44712,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -44190,6 +44787,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -44226,6 +44824,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -44250,6 +44849,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -44361,6 +44961,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -44397,6 +44998,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -44421,6 +45023,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -44664,6 +45267,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -44700,6 +45304,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -44724,6 +45329,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -44934,6 +45540,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -44970,6 +45577,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -44994,6 +45602,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -45262,6 +45871,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -45298,6 +45908,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -45322,6 +45933,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -45557,6 +46169,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -45593,6 +46206,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -45617,6 +46231,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -46196,6 +46811,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -46232,6 +46848,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -46256,6 +46873,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -46348,6 +46966,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -46384,6 +47003,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -46408,6 +47028,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -46510,6 +47131,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -46546,6 +47168,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -46570,6 +47193,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -47170,6 +47794,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -47206,6 +47831,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -47230,6 +47856,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -47428,6 +48055,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -47464,6 +48092,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -47488,6 +48117,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -47587,6 +48217,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -47623,6 +48254,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -47647,6 +48279,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -47721,6 +48354,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -47757,6 +48391,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -47781,6 +48416,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -48265,6 +48901,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -48301,6 +48938,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -48325,6 +48963,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -48524,15 +49163,15 @@ }, "routeAction": { "$ref": "HttpRouteAction", - "description": "In response to a matching matchRule, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of urlRedirect, service or routeAction.weightedBackendService must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a route rule's routeAction." + "description": "In response to a matching matchRule, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a route rule's routeAction." }, "service": { - "description": "The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.", + "description": "The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of urlRedirect, service or routeAction.weightedBackendService can be set.", "type": "string" }, "urlRedirect": { "$ref": "HttpRedirectAction", - "description": "When this rule is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy." + "description": "When this rule is matched, the request is redirected to a URL specified by urlRedirect. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy." } }, "type": "object" @@ -48707,6 +49346,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -48743,6 +49383,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -48767,6 +49408,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -49091,6 +49733,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -49127,6 +49770,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -49151,6 +49795,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -49541,6 +50186,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -49577,276 +50223,6 @@ false, false, false, - false - ], - "enumDescriptions": [ - "Warning about failed cleanup of transient changes made by a failed operation.", - "A link to a deprecated resource was created.", - "When deploying and at least one of the resources has a type marked as deprecated", - "The user created a boot disk that is larger than image size.", - "When deploying and at least one of the resources has a type marked as experimental", - "Warning that is present in an external api call", - "Warning that value of a field has been overridden. Deprecated unused field.", - "The operation involved use of an injected kernel, which is deprecated.", - "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", - "When deploying a deployment with a exceedingly large number of resources", - "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", - "A resource depends on a missing type", - "The route's nextHopIp address is not assigned to an instance on the network.", - "The route's next hop instance cannot ip forward.", - "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", - "The route's nextHopInstance URL refers to an instance that does not exist.", - "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", - "The route's next hop instance does not have a status of RUNNING.", - "Error which is not critical. We decided to continue the process despite the mentioned error.", - "No results are present on a particular list page.", - "Success is reported, but some results may be missing due to errors", - "The user attempted to use a resource that requires a TOS they have not accepted.", - "Warning that a resource is in use.", - "One or more of the resources set to auto-delete could not be deleted because they were in use.", - "When a resource schema validation is ignored.", - "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", - "When undeclared properties in the schema are present", - "A given scope cannot be reached." - ], - "type": "string" - }, - "data": { - "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", - "items": { - "properties": { - "key": { - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", - "type": "string" - }, - "value": { - "description": "[Output Only] A warning data value corresponding to the key.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "[Output Only] A human-readable description of the warning code.", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "InstanceConsumptionData": { - "id": "InstanceConsumptionData", - "properties": { - "consumptionInfo": { - "$ref": "InstanceConsumptionInfo", - "description": "Resources consumed by the instance." - }, - "instance": { - "description": "Server-defined URL for the instance.", - "type": "string" - } - }, - "type": "object" - }, - "InstanceConsumptionInfo": { - "id": "InstanceConsumptionInfo", - "properties": { - "guestCpus": { - "description": "The number of virtual CPUs that are available to the instance.", - "format": "int32", - "type": "integer" - }, - "localSsdGb": { - "description": "The amount of local SSD storage available to the instance, defined in GiB.", - "format": "int32", - "type": "integer" - }, - "memoryMb": { - "description": "The amount of physical memory available to the instance, defined in MiB.", - "format": "int32", - "type": "integer" - }, - "minNodeCpus": { - "description": "The minimal guaranteed number of virtual CPUs that are reserved.", - "format": "int32", - "type": "integer" - } - }, - "type": "object" - }, - "InstanceGroup": { - "description": "Represents an Instance Group resource. Instance Groups can be used to configure a target for load balancing. Instance groups can either be managed or unmanaged. To create managed instance groups, use the instanceGroupManager or regionInstanceGroupManager resource instead. Use zonal unmanaged instance groups if you need to apply load balancing to groups of heterogeneous instances or if you need to manage the instances yourself. You cannot create regional unmanaged instance groups. For more information, read Instance groups.", - "id": "InstanceGroup", - "properties": { - "creationTimestamp": { - "description": "[Output Only] The creation timestamp for this instance group in RFC3339 text format.", - "type": "string" - }, - "description": { - "description": "An optional description of this resource. Provide this property when you create the resource.", - "type": "string" - }, - "fingerprint": { - "description": "[Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently.", - "format": "byte", - "type": "string" - }, - "id": { - "description": "[Output Only] A unique identifier for this instance group, generated by the server.", - "format": "uint64", - "type": "string" - }, - "kind": { - "default": "compute#instanceGroup", - "description": "[Output Only] The resource type, which is always compute#instanceGroup for instance groups.", - "type": "string" - }, - "name": { - "annotations": { - "required": [ - "compute.instanceGroups.insert" - ] - }, - "description": "The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.", - "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", - "type": "string" - }, - "namedPorts": { - "description": " Assigns a name to a port number. For example: {name: \"http\", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: \"app1\", port: 8080}, {name: \"app1\", port: 8081}, {name: \"app2\", port: 8082}] Named ports apply to all instances in this instance group. ", - "items": { - "$ref": "NamedPort" - }, - "type": "array" - }, - "network": { - "description": "[Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0).", - "type": "string" - }, - "region": { - "description": "[Output Only] The URL of the region where the instance group is located (for regional resources).", - "type": "string" - }, - "selfLink": { - "description": "[Output Only] The URL for this instance group. The server generates this URL.", - "type": "string" - }, - "size": { - "description": "[Output Only] The total number of instances in the instance group.", - "format": "int32", - "type": "integer" - }, - "subnetwork": { - "description": "[Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0).", - "type": "string" - }, - "zone": { - "description": "[Output Only] The URL of the zone where the instance group is located (for zonal resources).", - "type": "string" - } - }, - "type": "object" - }, - "InstanceGroupAggregatedList": { - "id": "InstanceGroupAggregatedList", - "properties": { - "id": { - "description": "[Output Only] Unique identifier for the resource; defined by the server.", - "type": "string" - }, - "items": { - "additionalProperties": { - "$ref": "InstanceGroupsScopedList", - "description": "The name of the scope that contains this set of instance groups." - }, - "description": "A list of InstanceGroupsScopedList resources.", - "type": "object" - }, - "kind": { - "default": "compute#instanceGroupAggregatedList", - "description": "[Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.", - "type": "string" - }, - "nextPageToken": { - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", - "type": "string" - }, - "selfLink": { - "description": "[Output Only] Server-defined URL for this resource.", - "type": "string" - }, - "unreachables": { - "description": "[Output Only] Unreachable resources.", - "items": { - "type": "string" - }, - "type": "array" - }, - "warning": { - "description": "[Output Only] Informational warning message.", - "properties": { - "code": { - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "CLEANUP_FAILED", - "DEPRECATED_RESOURCE_USED", - "DEPRECATED_TYPE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "EXPERIMENTAL_TYPE_USED", - "EXTERNAL_API_WARNING", - "FIELD_VALUE_OVERRIDEN", - "INJECTED_KERNELS_DEPRECATED", - "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", - "LARGE_DEPLOYMENT_WARNING", - "LIST_OVERHEAD_QUOTA_EXCEED", - "MISSING_TYPE_DEPENDENCY", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "PARTIAL_SUCCESS", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", - "RESOURCE_NOT_DELETED", - "SCHEMA_VALIDATION_IGNORED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNDECLARED_PROPERTIES", - "UNREACHABLE" - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, false, false ], @@ -49872,6 +50248,281 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "InstanceConsumptionData": { + "id": "InstanceConsumptionData", + "properties": { + "consumptionInfo": { + "$ref": "InstanceConsumptionInfo", + "description": "Resources consumed by the instance." + }, + "instance": { + "description": "Server-defined URL for the instance.", + "type": "string" + } + }, + "type": "object" + }, + "InstanceConsumptionInfo": { + "id": "InstanceConsumptionInfo", + "properties": { + "guestCpus": { + "description": "The number of virtual CPUs that are available to the instance.", + "format": "int32", + "type": "integer" + }, + "localSsdGb": { + "description": "The amount of local SSD storage available to the instance, defined in GiB.", + "format": "int32", + "type": "integer" + }, + "memoryMb": { + "description": "The amount of physical memory available to the instance, defined in MiB.", + "format": "int32", + "type": "integer" + }, + "minNodeCpus": { + "description": "The minimal guaranteed number of virtual CPUs that are reserved.", + "format": "int32", + "type": "integer" + } + }, + "type": "object" + }, + "InstanceGroup": { + "description": "Represents an Instance Group resource. Instance Groups can be used to configure a target for load balancing. Instance groups can either be managed or unmanaged. To create managed instance groups, use the instanceGroupManager or regionInstanceGroupManager resource instead. Use zonal unmanaged instance groups if you need to apply load balancing to groups of heterogeneous instances or if you need to manage the instances yourself. You cannot create regional unmanaged instance groups. For more information, read Instance groups.", + "id": "InstanceGroup", + "properties": { + "creationTimestamp": { + "description": "[Output Only] The creation timestamp for this instance group in RFC3339 text format.", + "type": "string" + }, + "description": { + "description": "An optional description of this resource. Provide this property when you create the resource.", + "type": "string" + }, + "fingerprint": { + "description": "[Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently.", + "format": "byte", + "type": "string" + }, + "id": { + "description": "[Output Only] A unique identifier for this instance group, generated by the server.", + "format": "uint64", + "type": "string" + }, + "kind": { + "default": "compute#instanceGroup", + "description": "[Output Only] The resource type, which is always compute#instanceGroup for instance groups.", + "type": "string" + }, + "name": { + "annotations": { + "required": [ + "compute.instanceGroups.insert" + ] + }, + "description": "The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "type": "string" + }, + "namedPorts": { + "description": " Assigns a name to a port number. For example: {name: \"http\", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: \"app1\", port: 8080}, {name: \"app1\", port: 8081}, {name: \"app2\", port: 8082}] Named ports apply to all instances in this instance group. ", + "items": { + "$ref": "NamedPort" + }, + "type": "array" + }, + "network": { + "description": "[Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0).", + "type": "string" + }, + "region": { + "description": "[Output Only] The URL of the region where the instance group is located (for regional resources).", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] The URL for this instance group. The server generates this URL.", + "type": "string" + }, + "size": { + "description": "[Output Only] The total number of instances in the instance group.", + "format": "int32", + "type": "integer" + }, + "subnetwork": { + "description": "[Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0).", + "type": "string" + }, + "zone": { + "description": "[Output Only] The URL of the zone where the instance group is located (for zonal resources).", + "type": "string" + } + }, + "type": "object" + }, + "InstanceGroupAggregatedList": { + "id": "InstanceGroupAggregatedList", + "properties": { + "id": { + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { + "additionalProperties": { + "$ref": "InstanceGroupsScopedList", + "description": "The name of the scope that contains this set of instance groups." + }, + "description": "A list of InstanceGroupsScopedList resources.", + "type": "object" + }, + "kind": { + "default": "compute#instanceGroupAggregatedList", + "description": "[Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.", + "type": "string" + }, + "nextPageToken": { + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] Server-defined URL for this resource.", + "type": "string" + }, + "unreachables": { + "description": "[Output Only] Unreachable resources.", + "items": { + "type": "string" + }, + "type": "array" + }, + "warning": { + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -49964,6 +50615,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -50000,6 +50652,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -50024,6 +50677,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -50173,6 +50827,10 @@ "description": "[Output Only] The URL for this managed instance group. The server defines this URL.", "type": "string" }, + "standbyPolicy": { + "$ref": "InstanceGroupManagerStandbyPolicy", + "description": "Standby policy for stopped and suspended instances." + }, "statefulPolicy": { "$ref": "StatefulPolicy", "description": "Stateful configuration for this Instanced Group Manager" @@ -50199,6 +50857,16 @@ "format": "int32", "type": "integer" }, + "targetStoppedSize": { + "description": "The target number of stopped instances for this managed instance group. This number changes when you: - Stop instance using the stopInstances method or start instances using the startInstances method. - Manually change the targetStoppedSize using the update method. ", + "format": "int32", + "type": "integer" + }, + "targetSuspendedSize": { + "description": "The target number of suspended instances for this managed instance group. This number changes when you: - Suspend instance using the suspendInstances method or resume instances using the resumeInstances method. - Manually change the targetSuspendedSize using the update method. ", + "format": "int32", + "type": "integer" + }, "updatePolicy": { "$ref": "InstanceGroupManagerUpdatePolicy", "description": "The update policy for this managed instance group." @@ -50350,6 +51018,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -50386,6 +51055,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -50410,6 +51080,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -50588,6 +51259,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -50624,6 +51296,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -50648,6 +51321,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -50932,6 +51606,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -50968,6 +51643,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -50992,6 +51668,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -51029,6 +51706,29 @@ }, "type": "object" }, + "InstanceGroupManagerStandbyPolicy": { + "id": "InstanceGroupManagerStandbyPolicy", + "properties": { + "initialDelaySec": { + "description": "Specifies the number of seconds that the MIG should wait to suspend or stop a VM after that VM was created. The initial delay gives the initialization script the time to prepare your VM for a quick scale out. The value of initial delay must be between 0 and 3600 seconds. The default value is 0.", + "format": "int32", + "type": "integer" + }, + "mode": { + "description": "Defines how a MIG resumes or starts VMs from a standby pool when the group scales out. The default mode is `MANUAL`.", + "enum": [ + "MANUAL", + "SCALE_OUT_POOL" + ], + "enumDescriptions": [ + "MIG does not automatically resume or start VMs in the standby pool when the group scales out.", + "MIG automatically resumes or starts VMs in the standby pool when the group scales out, and replenishes the standby pool afterwards." + ], + "type": "string" + } + }, + "type": "object" + }, "InstanceGroupManagerStatus": { "id": "InstanceGroupManagerStatus", "properties": { @@ -51386,6 +52086,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -51422,6 +52123,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -51446,6 +52148,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -51510,6 +52213,19 @@ }, "type": "object" }, + "InstanceGroupManagersResumeInstancesRequest": { + "id": "InstanceGroupManagersResumeInstancesRequest", + "properties": { + "instances": { + "description": "The URLs of one or more instances to resume. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "InstanceGroupManagersScopedList": { "id": "InstanceGroupManagersScopedList", "properties": { @@ -51547,6 +52263,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -51583,6 +52300,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -51607,6 +52325,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -51672,6 +52391,53 @@ }, "type": "object" }, + "InstanceGroupManagersStartInstancesRequest": { + "id": "InstanceGroupManagersStartInstancesRequest", + "properties": { + "instances": { + "description": "The URLs of one or more instances to start. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "InstanceGroupManagersStopInstancesRequest": { + "id": "InstanceGroupManagersStopInstancesRequest", + "properties": { + "forceStop": { + "description": "If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them.", + "type": "boolean" + }, + "instances": { + "description": "The URLs of one or more instances to stop. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "InstanceGroupManagersSuspendInstancesRequest": { + "id": "InstanceGroupManagersSuspendInstancesRequest", + "properties": { + "forceSuspend": { + "description": "If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them.", + "type": "boolean" + }, + "instances": { + "description": "The URLs of one or more instances to suspend. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "InstanceGroupManagersUpdatePerInstanceConfigsReq": { "description": "InstanceGroupManagers.updatePerInstanceConfigs", "id": "InstanceGroupManagersUpdatePerInstanceConfigsReq", @@ -51753,6 +52519,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -51789,6 +52556,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -51813,6 +52581,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -51918,6 +52687,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -51954,6 +52724,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -51978,6 +52749,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -52088,6 +52860,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -52124,6 +52897,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -52148,6 +52922,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -52240,6 +53015,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -52276,6 +53052,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -52300,6 +53077,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -52766,6 +53544,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -52802,6 +53581,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -52826,6 +53606,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -52918,6 +53699,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -52954,6 +53736,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -52978,6 +53761,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -53052,6 +53836,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -53088,6 +53873,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -53112,6 +53898,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -53341,6 +54128,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -53377,6 +54165,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -53401,6 +54190,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -53727,6 +54517,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -53763,6 +54554,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -53787,6 +54579,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -53879,6 +54672,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -53915,6 +54709,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -53939,6 +54734,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -54024,6 +54820,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -54060,6 +54857,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -54084,6 +54882,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -54681,6 +55480,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -54717,198 +55517,6 @@ false, false, false, - false - ], - "enumDescriptions": [ - "Warning about failed cleanup of transient changes made by a failed operation.", - "A link to a deprecated resource was created.", - "When deploying and at least one of the resources has a type marked as deprecated", - "The user created a boot disk that is larger than image size.", - "When deploying and at least one of the resources has a type marked as experimental", - "Warning that is present in an external api call", - "Warning that value of a field has been overridden. Deprecated unused field.", - "The operation involved use of an injected kernel, which is deprecated.", - "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", - "When deploying a deployment with a exceedingly large number of resources", - "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", - "A resource depends on a missing type", - "The route's nextHopIp address is not assigned to an instance on the network.", - "The route's next hop instance cannot ip forward.", - "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", - "The route's nextHopInstance URL refers to an instance that does not exist.", - "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", - "The route's next hop instance does not have a status of RUNNING.", - "Error which is not critical. We decided to continue the process despite the mentioned error.", - "No results are present on a particular list page.", - "Success is reported, but some results may be missing due to errors", - "The user attempted to use a resource that requires a TOS they have not accepted.", - "Warning that a resource is in use.", - "One or more of the resources set to auto-delete could not be deleted because they were in use.", - "When a resource schema validation is ignored.", - "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", - "When undeclared properties in the schema are present", - "A given scope cannot be reached." - ], - "type": "string" - }, - "data": { - "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", - "items": { - "properties": { - "key": { - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", - "type": "string" - }, - "value": { - "description": "[Output Only] A warning data value corresponding to the key.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "[Output Only] A human-readable description of the warning code.", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "InterconnectAttachmentConfigurationConstraints": { - "id": "InterconnectAttachmentConfigurationConstraints", - "properties": { - "bgpMd5": { - "description": "[Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested.", - "enum": [ - "MD5_OPTIONAL", - "MD5_REQUIRED", - "MD5_UNSUPPORTED" - ], - "enumDescriptions": [ - "MD5_OPTIONAL: BGP MD5 authentication is supported and can optionally be configured.", - "MD5_REQUIRED: BGP MD5 authentication must be configured.", - "MD5_UNSUPPORTED: BGP MD5 authentication must not be configured" - ], - "type": "string" - }, - "bgpPeerAsnRanges": { - "description": "[Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend.", - "items": { - "$ref": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange" - }, - "type": "array" - } - }, - "type": "object" - }, - "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange": { - "id": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange", - "properties": { - "max": { - "format": "uint32", - "type": "integer" - }, - "min": { - "format": "uint32", - "type": "integer" - } - }, - "type": "object" - }, - "InterconnectAttachmentList": { - "description": "Response to the list request, and contains a list of interconnect attachments.", - "id": "InterconnectAttachmentList", - "properties": { - "id": { - "description": "[Output Only] Unique identifier for the resource; defined by the server.", - "type": "string" - }, - "items": { - "description": "A list of InterconnectAttachment resources.", - "items": { - "$ref": "InterconnectAttachment" - }, - "type": "array" - }, - "kind": { - "default": "compute#interconnectAttachmentList", - "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments.", - "type": "string" - }, - "nextPageToken": { - "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", - "type": "string" - }, - "selfLink": { - "description": "[Output Only] Server-defined URL for this resource.", - "type": "string" - }, - "warning": { - "description": "[Output Only] Informational warning message.", - "properties": { - "code": { - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "CLEANUP_FAILED", - "DEPRECATED_RESOURCE_USED", - "DEPRECATED_TYPE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "EXPERIMENTAL_TYPE_USED", - "EXTERNAL_API_WARNING", - "FIELD_VALUE_OVERRIDEN", - "INJECTED_KERNELS_DEPRECATED", - "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", - "LARGE_DEPLOYMENT_WARNING", - "LIST_OVERHEAD_QUOTA_EXCEED", - "MISSING_TYPE_DEPENDENCY", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "PARTIAL_SUCCESS", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", - "RESOURCE_NOT_DELETED", - "SCHEMA_VALIDATION_IGNORED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNDECLARED_PROPERTIES", - "UNREACHABLE" - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, false, false ], @@ -54934,6 +55542,203 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "InterconnectAttachmentConfigurationConstraints": { + "id": "InterconnectAttachmentConfigurationConstraints", + "properties": { + "bgpMd5": { + "description": "[Output Only] Whether the attachment's BGP session requires/allows/disallows BGP MD5 authentication. This can take one of the following values: MD5_OPTIONAL, MD5_REQUIRED, MD5_UNSUPPORTED. For example, a Cross-Cloud Interconnect connection to a remote cloud provider that requires BGP MD5 authentication has the interconnectRemoteLocation attachment_configuration_constraints.bgp_md5 field set to MD5_REQUIRED, and that property is propagated to the attachment. Similarly, if BGP MD5 is MD5_UNSUPPORTED, an error is returned if MD5 is requested.", + "enum": [ + "MD5_OPTIONAL", + "MD5_REQUIRED", + "MD5_UNSUPPORTED" + ], + "enumDescriptions": [ + "MD5_OPTIONAL: BGP MD5 authentication is supported and can optionally be configured.", + "MD5_REQUIRED: BGP MD5 authentication must be configured.", + "MD5_UNSUPPORTED: BGP MD5 authentication must not be configured" + ], + "type": "string" + }, + "bgpPeerAsnRanges": { + "description": "[Output Only] List of ASN ranges that the remote location is known to support. Formatted as an array of inclusive ranges {min: min-value, max: max-value}. For example, [{min: 123, max: 123}, {min: 64512, max: 65534}] allows the peer ASN to be 123 or anything in the range 64512-65534. This field is only advisory. Although the API accepts other ranges, these are the ranges that we recommend.", + "items": { + "$ref": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange" + }, + "type": "array" + } + }, + "type": "object" + }, + "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange": { + "id": "InterconnectAttachmentConfigurationConstraintsBgpPeerASNRange", + "properties": { + "max": { + "format": "uint32", + "type": "integer" + }, + "min": { + "format": "uint32", + "type": "integer" + } + }, + "type": "object" + }, + "InterconnectAttachmentList": { + "description": "Response to the list request, and contains a list of interconnect attachments.", + "id": "InterconnectAttachmentList", + "properties": { + "id": { + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { + "description": "A list of InterconnectAttachment resources.", + "items": { + "$ref": "InterconnectAttachment" + }, + "type": "array" + }, + "kind": { + "default": "compute#interconnectAttachmentList", + "description": "[Output Only] Type of resource. Always compute#interconnectAttachmentList for lists of interconnect attachments.", + "type": "string" + }, + "nextPageToken": { + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] Server-defined URL for this resource.", + "type": "string" + }, + "warning": { + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -55039,6 +55844,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -55075,6 +55881,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -55099,6 +55906,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -55392,6 +56200,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -55428,6 +56237,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -55452,6 +56262,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -55502,7 +56313,7 @@ "type": "string" }, "availableFeatures": { - "description": "[Output only] List of features available at this InterconnectLocation, which can take one of the following values: - MACSEC ", + "description": "[Output only] List of features available at this InterconnectLocation, which can take one of the following values: - IF_MACSEC ", "items": { "enum": [ "IF_MACSEC" @@ -55680,6 +56491,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -55716,6 +56528,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -55740,6 +56553,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -56184,6 +56998,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -56220,6 +57035,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -56244,6 +57060,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -56357,7 +57174,8 @@ "type": "string" }, "resourceRequirements": { - "$ref": "LicenseResourceRequirements" + "$ref": "LicenseResourceRequirements", + "description": "[Input Only] Deprecated." }, "selfLink": { "description": "[Output Only] Server-defined URL for the resource.", @@ -56476,12 +57294,12 @@ "id": "LicenseResourceRequirements", "properties": { "minGuestCpuCount": { - "description": "Minimum number of guest cpus required to use the Instance. Enforced at Instance creation and Instance start.", + "description": "[Input Only] Deprecated. This field no longer reflects the minimum number of guest cpus required to use the Instance.", "format": "int32", "type": "integer" }, "minMemoryMb": { - "description": "Minimum memory required to use the Instance. Enforced at Instance creation and Instance start.", + "description": "[Input Only] Deprecated. This field no longer reflects the minimum memory required to use the Instance.", "format": "int32", "type": "integer" } @@ -56537,6 +57355,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -56573,6 +57392,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -56597,6 +57417,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -56900,6 +57721,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -56936,6 +57758,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -56960,6 +57783,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -57176,6 +58000,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -57212,6 +58037,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -57236,6 +58062,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -57328,6 +58155,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -57364,139 +58192,6 @@ false, false, false, - false - ], - "enumDescriptions": [ - "Warning about failed cleanup of transient changes made by a failed operation.", - "A link to a deprecated resource was created.", - "When deploying and at least one of the resources has a type marked as deprecated", - "The user created a boot disk that is larger than image size.", - "When deploying and at least one of the resources has a type marked as experimental", - "Warning that is present in an external api call", - "Warning that value of a field has been overridden. Deprecated unused field.", - "The operation involved use of an injected kernel, which is deprecated.", - "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", - "When deploying a deployment with a exceedingly large number of resources", - "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", - "A resource depends on a missing type", - "The route's nextHopIp address is not assigned to an instance on the network.", - "The route's next hop instance cannot ip forward.", - "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", - "The route's nextHopInstance URL refers to an instance that does not exist.", - "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", - "The route's next hop instance does not have a status of RUNNING.", - "Error which is not critical. We decided to continue the process despite the mentioned error.", - "No results are present on a particular list page.", - "Success is reported, but some results may be missing due to errors", - "The user attempted to use a resource that requires a TOS they have not accepted.", - "Warning that a resource is in use.", - "One or more of the resources set to auto-delete could not be deleted because they were in use.", - "When a resource schema validation is ignored.", - "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", - "When undeclared properties in the schema are present", - "A given scope cannot be reached." - ], - "type": "string" - }, - "data": { - "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", - "items": { - "properties": { - "key": { - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", - "type": "string" - }, - "value": { - "description": "[Output Only] A warning data value corresponding to the key.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "[Output Only] A human-readable description of the warning code.", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "MachineTypesScopedList": { - "id": "MachineTypesScopedList", - "properties": { - "machineTypes": { - "description": "[Output Only] A list of machine types contained in this scope.", - "items": { - "$ref": "MachineType" - }, - "type": "array" - }, - "warning": { - "description": "[Output Only] An informational warning that appears when the machine types list is empty.", - "properties": { - "code": { - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "CLEANUP_FAILED", - "DEPRECATED_RESOURCE_USED", - "DEPRECATED_TYPE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "EXPERIMENTAL_TYPE_USED", - "EXTERNAL_API_WARNING", - "FIELD_VALUE_OVERRIDEN", - "INJECTED_KERNELS_DEPRECATED", - "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", - "LARGE_DEPLOYMENT_WARNING", - "LIST_OVERHEAD_QUOTA_EXCEED", - "MISSING_TYPE_DEPENDENCY", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "PARTIAL_SUCCESS", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", - "RESOURCE_NOT_DELETED", - "SCHEMA_VALIDATION_IGNORED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNDECLARED_PROPERTIES", - "UNREACHABLE" - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, false, false ], @@ -57522,6 +58217,144 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "MachineTypesScopedList": { + "id": "MachineTypesScopedList", + "properties": { + "machineTypes": { + "description": "[Output Only] A list of machine types contained in this scope.", + "items": { + "$ref": "MachineType" + }, + "type": "array" + }, + "warning": { + "description": "[Output Only] An informational warning that appears when the machine types list is empty.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -58023,6 +58856,10 @@ ], "type": "string" }, + "networkProfile": { + "description": "A full or partial URL of the network profile to apply to this network. This field can be set only at resource creation time. For example, the following are valid URLs: - https://www.googleapis.com/compute/{api_version}/projects/{project_id}/global/networkProfiles/{network_profile_name} - projects/{project_id}/global/networkProfiles/{network_profile_name} ", + "type": "string" + }, "peerings": { "description": "[Output Only] A list of network peerings for the resource.", "items": { @@ -58204,6 +59041,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -58240,6 +59078,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -58264,6 +59103,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -58408,6 +59248,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -58444,139 +59285,6 @@ false, false, false, - false - ], - "enumDescriptions": [ - "Warning about failed cleanup of transient changes made by a failed operation.", - "A link to a deprecated resource was created.", - "When deploying and at least one of the resources has a type marked as deprecated", - "The user created a boot disk that is larger than image size.", - "When deploying and at least one of the resources has a type marked as experimental", - "Warning that is present in an external api call", - "Warning that value of a field has been overridden. Deprecated unused field.", - "The operation involved use of an injected kernel, which is deprecated.", - "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", - "When deploying a deployment with a exceedingly large number of resources", - "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", - "A resource depends on a missing type", - "The route's nextHopIp address is not assigned to an instance on the network.", - "The route's next hop instance cannot ip forward.", - "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", - "The route's nextHopInstance URL refers to an instance that does not exist.", - "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", - "The route's next hop instance does not have a status of RUNNING.", - "Error which is not critical. We decided to continue the process despite the mentioned error.", - "No results are present on a particular list page.", - "Success is reported, but some results may be missing due to errors", - "The user attempted to use a resource that requires a TOS they have not accepted.", - "Warning that a resource is in use.", - "One or more of the resources set to auto-delete could not be deleted because they were in use.", - "When a resource schema validation is ignored.", - "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", - "When undeclared properties in the schema are present", - "A given scope cannot be reached." - ], - "type": "string" - }, - "data": { - "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", - "items": { - "properties": { - "key": { - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", - "type": "string" - }, - "value": { - "description": "[Output Only] A warning data value corresponding to the key.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "[Output Only] A human-readable description of the warning code.", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "NetworkAttachmentsScopedList": { - "id": "NetworkAttachmentsScopedList", - "properties": { - "networkAttachments": { - "description": "A list of NetworkAttachments contained in this scope.", - "items": { - "$ref": "NetworkAttachment" - }, - "type": "array" - }, - "warning": { - "description": "Informational warning which replaces the list of network attachments when the list is empty.", - "properties": { - "code": { - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "CLEANUP_FAILED", - "DEPRECATED_RESOURCE_USED", - "DEPRECATED_TYPE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "EXPERIMENTAL_TYPE_USED", - "EXTERNAL_API_WARNING", - "FIELD_VALUE_OVERRIDEN", - "INJECTED_KERNELS_DEPRECATED", - "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", - "LARGE_DEPLOYMENT_WARNING", - "LIST_OVERHEAD_QUOTA_EXCEED", - "MISSING_TYPE_DEPENDENCY", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "PARTIAL_SUCCESS", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", - "RESOURCE_NOT_DELETED", - "SCHEMA_VALIDATION_IGNORED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNDECLARED_PROPERTIES", - "UNREACHABLE" - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, false, false ], @@ -58602,6 +59310,144 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "NetworkAttachmentsScopedList": { + "id": "NetworkAttachmentsScopedList", + "properties": { + "networkAttachments": { + "description": "A list of NetworkAttachments contained in this scope.", + "items": { + "$ref": "NetworkAttachment" + }, + "type": "array" + }, + "warning": { + "description": "Informational warning which replaces the list of network attachments when the list is empty.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -58755,6 +59601,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -58791,6 +59638,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -58815,6 +59663,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -58889,6 +59738,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -58925,6 +59775,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -58949,6 +59800,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -59197,6 +60049,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -59233,6 +60086,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -59257,6 +60111,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -59401,6 +60256,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -59437,6 +60293,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -59461,6 +60318,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -59633,6 +60491,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -59669,139 +60528,6 @@ false, false, false, - false - ], - "enumDescriptions": [ - "Warning about failed cleanup of transient changes made by a failed operation.", - "A link to a deprecated resource was created.", - "When deploying and at least one of the resources has a type marked as deprecated", - "The user created a boot disk that is larger than image size.", - "When deploying and at least one of the resources has a type marked as experimental", - "Warning that is present in an external api call", - "Warning that value of a field has been overridden. Deprecated unused field.", - "The operation involved use of an injected kernel, which is deprecated.", - "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", - "When deploying a deployment with a exceedingly large number of resources", - "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", - "A resource depends on a missing type", - "The route's nextHopIp address is not assigned to an instance on the network.", - "The route's next hop instance cannot ip forward.", - "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", - "The route's nextHopInstance URL refers to an instance that does not exist.", - "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", - "The route's next hop instance does not have a status of RUNNING.", - "Error which is not critical. We decided to continue the process despite the mentioned error.", - "No results are present on a particular list page.", - "Success is reported, but some results may be missing due to errors", - "The user attempted to use a resource that requires a TOS they have not accepted.", - "Warning that a resource is in use.", - "One or more of the resources set to auto-delete could not be deleted because they were in use.", - "When a resource schema validation is ignored.", - "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", - "When undeclared properties in the schema are present", - "A given scope cannot be reached." - ], - "type": "string" - }, - "data": { - "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", - "items": { - "properties": { - "key": { - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", - "type": "string" - }, - "value": { - "description": "[Output Only] A warning data value corresponding to the key.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "[Output Only] A human-readable description of the warning code.", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "NetworkEndpointGroupsScopedList": { - "id": "NetworkEndpointGroupsScopedList", - "properties": { - "networkEndpointGroups": { - "description": "[Output Only] The list of network endpoint groups that are contained in this scope.", - "items": { - "$ref": "NetworkEndpointGroup" - }, - "type": "array" - }, - "warning": { - "description": "[Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty.", - "properties": { - "code": { - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "CLEANUP_FAILED", - "DEPRECATED_RESOURCE_USED", - "DEPRECATED_TYPE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "EXPERIMENTAL_TYPE_USED", - "EXTERNAL_API_WARNING", - "FIELD_VALUE_OVERRIDEN", - "INJECTED_KERNELS_DEPRECATED", - "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", - "LARGE_DEPLOYMENT_WARNING", - "LIST_OVERHEAD_QUOTA_EXCEED", - "MISSING_TYPE_DEPENDENCY", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "PARTIAL_SUCCESS", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", - "RESOURCE_NOT_DELETED", - "SCHEMA_VALIDATION_IGNORED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNDECLARED_PROPERTIES", - "UNREACHABLE" - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, false, false ], @@ -59827,6 +60553,144 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "NetworkEndpointGroupsScopedList": { + "id": "NetworkEndpointGroupsScopedList", + "properties": { + "networkEndpointGroups": { + "description": "[Output Only] The list of network endpoint groups that are contained in this scope.", + "items": { + "$ref": "NetworkEndpointGroup" + }, + "type": "array" + }, + "warning": { + "description": "[Output Only] An informational warning that replaces the list of network endpoint groups when the list is empty.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -59958,12 +60822,16 @@ "enum": [ "GVNIC", "IDPF", + "IRDMA", + "MRDMA", "UNSPECIFIED_NIC_TYPE", "VIRTIO_NET" ], "enumDescriptions": [ "GVNIC", "IDPF", + "IRDMA", + "MRDMA", "No type specified.", "VIRTIO" ], @@ -60050,6 +60918,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -60086,6 +60955,635 @@ false, false, false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "NetworkPeering": { + "description": "A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering.", + "id": "NetworkPeering", + "properties": { + "autoCreateRoutes": { + "description": "This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.", + "type": "boolean" + }, + "exchangeSubnetRoutes": { + "description": "Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.", + "type": "boolean" + }, + "exportCustomRoutes": { + "description": "Whether to export the custom routes to peer network. The default value is false.", + "type": "boolean" + }, + "exportSubnetRoutesWithPublicIp": { + "description": "Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.", + "type": "boolean" + }, + "importCustomRoutes": { + "description": "Whether to import the custom routes from peer network. The default value is false.", + "type": "boolean" + }, + "importSubnetRoutesWithPublicIp": { + "description": "Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.", + "type": "boolean" + }, + "name": { + "description": "Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "type": "string" + }, + "network": { + "description": "The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.", + "type": "string" + }, + "peerMtu": { + "description": "Maximum Transmission Unit in bytes.", + "format": "int32", + "type": "integer" + }, + "stackType": { + "description": "Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY.", + "enum": [ + "IPV4_IPV6", + "IPV4_ONLY" + ], + "enumDescriptions": [ + "This Peering will allow IPv4 traffic and routes to be exchanged. Additionally if the matching peering is IPV4_IPV6, IPv6 traffic and routes will be exchanged as well.", + "This Peering will only allow IPv4 traffic and routes to be exchanged, even if the matching peering is IPV4_IPV6." + ], + "type": "string" + }, + "state": { + "description": "[Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network.", + "enum": [ + "ACTIVE", + "INACTIVE" + ], + "enumDescriptions": [ + "Matching configuration exists on the peer.", + "There is no matching configuration on the peer, including the case when peer does not exist." + ], + "type": "string" + }, + "stateDetails": { + "description": "[Output Only] Details about the current state of the peering.", + "type": "string" + } + }, + "type": "object" + }, + "NetworkPerformanceConfig": { + "id": "NetworkPerformanceConfig", + "properties": { + "totalEgressBandwidthTier": { + "enum": [ + "DEFAULT", + "TIER_1" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + } + }, + "type": "object" + }, + "NetworkProfile": { + "description": "NetworkProfile represents a Google managed network profile resource.", + "id": "NetworkProfile", + "properties": { + "creationTimestamp": { + "description": "[Output Only] Creation timestamp in RFC3339 text format.", + "type": "string" + }, + "description": { + "description": "[Output Only] An optional description of this resource.", + "type": "string" + }, + "features": { + "$ref": "NetworkProfileNetworkFeatures", + "description": "[Output Only] Features supported by the network." + }, + "id": { + "description": "[Output Only] The unique identifier for the resource. This identifier is defined by the server.", + "format": "uint64", + "type": "string" + }, + "kind": { + "default": "compute#networkProfile", + "description": "[Output Only] Type of the resource. Always compute#networkProfile for network profiles.", + "type": "string" + }, + "location": { + "$ref": "NetworkProfileLocation", + "description": "[Output Only] Location to which the network is restricted." + }, + "name": { + "description": "[Output Only] Name of the resource.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] Server-defined URL for the resource.", + "type": "string" + }, + "selfLinkWithId": { + "description": "[Output Only] Server-defined URL for this resource with the resource id.", + "type": "string" + }, + "zone": { + "description": "[Output Only] Zone to which the network is restricted.", + "type": "string" + } + }, + "type": "object" + }, + "NetworkProfileLocation": { + "id": "NetworkProfileLocation", + "properties": { + "name": { + "type": "string" + }, + "scope": { + "enum": [ + "REGION", + "ZONE" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + } + }, + "type": "object" + }, + "NetworkProfileNetworkFeatures": { + "id": "NetworkProfileNetworkFeatures", + "properties": { + "addressPurposes": { + "description": "Specifies what address purposes are supported. If empty, all address purposes are supported.", + "items": { + "enum": [ + "DNS_RESOLVER", + "GCE_ENDPOINT", + "IPSEC_INTERCONNECT", + "NAT_AUTO", + "PRIVATE_SERVICE_CONNECT", + "SERVERLESS", + "SHARED_LOADBALANCER_VIP", + "VPC_PEERING" + ], + "enumDescriptions": [ + "DNS resolver address in the subnetwork.", + "VM internal/alias IP, Internal LB service IP, etc.", + "A regional internal IP address range reserved for the VLAN attachment that is used in HA VPN over Cloud Interconnect. This regional internal IP address range must not overlap with any IP address range of subnet/route in the VPC network and its peering networks. After the VLAN attachment is created with the reserved IP address range, when creating a new VPN gateway, its interface IP address is allocated from the associated VLAN attachment’s IP address range.", + "External IP automatically reserved for Cloud NAT.", + "A private network IP address that can be used to configure Private Service Connect. This purpose can be specified only for GLOBAL addresses of Type INTERNAL", + "A regional internal IP address range reserved for Serverless.", + "A private network IP address that can be shared by multiple Internal Load Balancer forwarding rules.", + "IP range for peer networks." + ], + "type": "string" + }, + "type": "array" + }, + "allowAliasIpRanges": { + "description": "Specifies whether alias IP ranges (and secondary address ranges) are allowed.", + "enum": [ + "ALIAS_IP_RANGES_ALLOWED", + "ALIAS_IP_RANGES_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowAutoModeSubnet": { + "description": "Specifies whether auto mode subnet creation is allowed.", + "enum": [ + "AUTO_MODE_SUBNET_ALLOWED", + "AUTO_MODE_SUBNET_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowClassDFirewalls": { + "description": "Specifies whether firewalls for Class D address ranges are supported.", + "enum": [ + "CLASS_D_FIREWALLS_ALLOWED", + "CLASS_D_FIREWALLS_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowCloudNat": { + "description": "Specifies whether cloud NAT creation is allowed.", + "enum": [ + "CLOUD_NAT_ALLOWED", + "CLOUD_NAT_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowCloudRouter": { + "description": "Specifies whether cloud router creation is allowed.", + "enum": [ + "CLOUD_ROUTER_ALLOWED", + "CLOUD_ROUTER_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowExternalIpAccess": { + "description": "Specifies whether VMs are allowed to have external IP access on network interfaces connected to this VPC.", + "enum": [ + "EXTERNAL_IP_ACCESS_ALLOWED", + "EXTERNAL_IP_ACCESS_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowInterconnect": { + "description": "Specifies whether Cloud Interconnect creation is allowed.", + "enum": [ + "INTERCONNECT_ALLOWED", + "INTERCONNECT_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowLoadBalancing": { + "description": "Specifies whether cloud load balancing is allowed.", + "enum": [ + "LOAD_BALANCING_ALLOWED", + "LOAD_BALANCING_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowMultiNicInSameNetwork": { + "description": "Specifies whether multi-nic in the same network is allowed.", + "enum": [ + "MULTI_NIC_IN_SAME_NETWORK_ALLOWED", + "MULTI_NIC_IN_SAME_NETWORK_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowPacketMirroring": { + "description": "Specifies whether Packet Mirroring 1.0 is supported.", + "enum": [ + "PACKET_MIRRORING_ALLOWED", + "PACKET_MIRRORING_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowPrivateGoogleAccess": { + "description": "Specifies whether private Google access is allowed.", + "enum": [ + "PRIVATE_GOOGLE_ACCESS_ALLOWED", + "PRIVATE_GOOGLE_ACCESS_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowPsc": { + "description": "Specifies whether PSC creation is allowed.", + "enum": [ + "PSC_ALLOWED", + "PSC_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowSameNetworkUnicast": { + "description": "Specifies whether unicast within the same network is allowed.", + "enum": [ + "SAME_NETWORK_UNICAST_ALLOWED", + "SAME_NETWORK_UNICAST_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowStaticRoutes": { + "description": "Specifies whether static route creation is allowed.", + "enum": [ + "STATIC_ROUTES_ALLOWED", + "STATIC_ROUTES_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowSubInterfaces": { + "description": "Specifies whether sub interfaces are allowed.", + "enum": [ + "SUBINTERFACES_ALLOWED", + "SUBINTERFACES_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowVpcPeering": { + "description": "Specifies whether VPC peering is allowed.", + "enum": [ + "VPC_PEERING_ALLOWED", + "VPC_PEERING_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "allowVpn": { + "description": "Specifies whether VPN creation is allowed.", + "enum": [ + "VPN_ALLOWED", + "VPN_BLOCKED" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "interfaceTypes": { + "description": "If set, limits the interface types that the network supports. If empty, all interface types are supported.", + "items": { + "enum": [ + "GVNIC", + "IDPF", + "IRDMA", + "MRDMA", + "UNSPECIFIED_NIC_TYPE", + "VIRTIO_NET" + ], + "enumDescriptions": [ + "GVNIC", + "IDPF", + "IRDMA", + "MRDMA", + "No type specified.", + "VIRTIO" + ], + "type": "string" + }, + "type": "array" + }, + "subnetPurposes": { + "description": "Specifies which subnetwork purposes are supported.", + "items": { + "enum": [ + "SUBNET_PURPOSE_CUSTOM_HARDWARE", + "SUBNET_PURPOSE_PRIVATE" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + }, + "type": "array" + }, + "subnetStackTypes": { + "description": "Specifies which subnetwork stack types are supported.", + "items": { + "enum": [ + "SUBNET_STACK_TYPE_IPV4_IPV6", + "SUBNET_STACK_TYPE_IPV4_ONLY", + "SUBNET_STACK_TYPE_IPV6_ONLY" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "type": "string" + }, + "type": "array" + }, + "unicast": { + "description": "Specifies which type of unicast is supported.", + "enum": [ + "UNICAST_SDN", + "UNICAST_ULL" + ], + "enumDescriptions": [ + "", + "" + ], + "type": "string" + } + }, + "type": "object" + }, + "NetworkProfilesListResponse": { + "description": "Contains a list of network profiles.", + "id": "NetworkProfilesListResponse", + "properties": { + "etag": { + "type": "string" + }, + "id": { + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "type": "string" + }, + "items": { + "description": "A list of NetworkProfile resources.", + "items": { + "$ref": "NetworkProfile" + }, + "type": "array" + }, + "kind": { + "default": "compute#networkProfileList", + "description": "[Output Only] Type of resource. Always compute#networkProfileList for network profiles.", + "type": "string" + }, + "nextPageToken": { + "description": "[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.", + "type": "string" + }, + "selfLink": { + "description": "[Output Only] Server-defined URL for this resource.", + "type": "string" + }, + "unreachables": { + "description": "[Output Only] Unreachable resources. end_interface: MixerListResponseWithEtagBuilder", + "items": { + "type": "string" + }, + "type": "array" + }, + "warning": { + "description": "[Output Only] Informational warning message.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, false ], "enumDescriptions": [ @@ -60110,6 +61608,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -60147,99 +61646,38 @@ }, "type": "object" }, - "NetworkPeering": { - "description": "A network peering attached to a network resource. The message includes the peering name, peer network, peering state, and a flag indicating whether Google Compute Engine should automatically create routes for the peering.", - "id": "NetworkPeering", + "NetworkRoutingConfig": { + "description": "A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide.", + "id": "NetworkRoutingConfig", "properties": { - "autoCreateRoutes": { - "description": "This field will be deprecated soon. Use the exchange_subnet_routes field instead. Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.", - "type": "boolean" - }, - "exchangeSubnetRoutes": { - "description": "Indicates whether full mesh connectivity is created and managed automatically between peered networks. Currently this field should always be true since Google Compute Engine will automatically create and manage subnetwork routes between two networks when peering state is ACTIVE.", - "type": "boolean" - }, - "exportCustomRoutes": { - "description": "Whether to export the custom routes to peer network. The default value is false.", + "bgpAlwaysCompareMed": { + "description": "Enable comparison of Multi-Exit Discriminators (MED) across routes with different neighbor ASNs when using the STANDARD BGP best path selection algorithm.", "type": "boolean" }, - "exportSubnetRoutesWithPublicIp": { - "description": "Whether subnet routes with public IP range are exported. The default value is true, all subnet routes are exported. IPv4 special-use ranges are always exported to peers and are not controlled by this field.", - "type": "boolean" - }, - "importCustomRoutes": { - "description": "Whether to import the custom routes from peer network. The default value is false.", - "type": "boolean" - }, - "importSubnetRoutesWithPublicIp": { - "description": "Whether subnet routes with public IP range are imported. The default value is false. IPv4 special-use ranges are always imported from peers and are not controlled by this field.", - "type": "boolean" - }, - "name": { - "description": "Name of this peering. Provided by the client when the peering is created. The name must comply with RFC1035. Specifically, the name must be 1-63 characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?`. The first character must be a lowercase letter, and all the following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", - "type": "string" - }, - "network": { - "description": "The URL of the peer network. It can be either full URL or partial URL. The peer network may belong to a different project. If the partial URL does not contain project, it is assumed that the peer network is in the same project as the current network.", - "type": "string" - }, - "peerMtu": { - "description": "Maximum Transmission Unit in bytes.", - "format": "int32", - "type": "integer" - }, - "stackType": { - "description": "Which IP version(s) of traffic and routes are allowed to be imported or exported between peer networks. The default value is IPV4_ONLY.", + "bgpBestPathSelectionMode": { + "description": "The BGP best path selection algorithm to be employed within this network for dynamic routes learned by Cloud Routers. Can be LEGACY (default) or STANDARD.", "enum": [ - "IPV4_IPV6", - "IPV4_ONLY" - ], - "enumDescriptions": [ - "This Peering will allow IPv4 traffic and routes to be exchanged. Additionally if the matching peering is IPV4_IPV6, IPv6 traffic and routes will be exchanged as well.", - "This Peering will only allow IPv4 traffic and routes to be exchanged, even if the matching peering is IPV4_IPV6." - ], - "type": "string" - }, - "state": { - "description": "[Output Only] State for the peering, either `ACTIVE` or `INACTIVE`. The peering is `ACTIVE` when there's a matching configuration in the peer network.", - "enum": [ - "ACTIVE", - "INACTIVE" + "LEGACY", + "STANDARD" ], "enumDescriptions": [ - "Matching configuration exists on the peer.", - "There is no matching configuration on the peer, including the case when peer does not exist." + "", + "" ], "type": "string" }, - "stateDetails": { - "description": "[Output Only] Details about the current state of the peering.", - "type": "string" - } - }, - "type": "object" - }, - "NetworkPerformanceConfig": { - "id": "NetworkPerformanceConfig", - "properties": { - "totalEgressBandwidthTier": { + "bgpInterRegionCost": { + "description": "Allows to define a preferred approach for handling inter-region cost in the selection process when using the STANDARD BGP best path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED.", "enum": [ - "DEFAULT", - "TIER_1" + "ADD_COST_TO_MED", + "DEFAULT" ], "enumDescriptions": [ "", "" ], "type": "string" - } - }, - "type": "object" - }, - "NetworkRoutingConfig": { - "description": "A routing configuration attached to a network resource. The message includes the list of routers associated with the network, and a flag indicating the type of routing behavior to enforce network-wide.", - "id": "NetworkRoutingConfig", - "properties": { + }, "routingMode": { "description": "The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions.", "enum": [ @@ -60538,6 +61976,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -60574,6 +62013,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -60598,6 +62038,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -60722,6 +62163,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -60758,6 +62200,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -60782,6 +62225,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -61009,6 +62453,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -61045,6 +62490,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -61069,6 +62515,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -61160,6 +62607,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -61196,6 +62644,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -61220,6 +62669,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -61444,6 +62894,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -61480,6 +62931,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -61504,6 +62956,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -61596,6 +63049,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -61632,6 +63086,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -61656,6 +63111,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -61745,6 +63201,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -61781,6 +63238,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -61805,6 +63263,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -61965,6 +63424,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -62001,6 +63461,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -62025,6 +63486,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -62117,6 +63579,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -62153,6 +63616,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -62177,6 +63641,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -62251,6 +63716,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -62287,6 +63753,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -62311,6 +63778,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -62472,6 +63940,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -62508,6 +63977,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -62532,6 +64002,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -62755,6 +64226,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -62791,6 +64263,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -62815,6 +64288,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -62920,6 +64394,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -62956,6 +64431,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -62980,6 +64456,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -63072,6 +64549,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -63108,6 +64586,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -63132,6 +64611,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -63206,6 +64686,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -63242,6 +64723,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -63266,6 +64748,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -63566,6 +65049,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -63602,6 +65086,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -63626,6 +65111,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -63766,6 +65252,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -63802,6 +65289,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -63826,6 +65314,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -63969,6 +65458,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -64005,6 +65495,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -64029,6 +65520,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -64076,15 +65568,15 @@ }, "defaultRouteAction": { "$ref": "HttpRouteAction", - "description": "defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. If defaultRouteAction is specified, don't set defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is specified, don't set defaultService. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction." + "description": "defaultRouteAction takes effect when none of the pathRules or routeRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path matcher's defaultRouteAction." }, "defaultService": { - "description": "The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any weightedBackendServices. Conversely, if defaultRouteAction specifies any weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. Don't set both. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use ", + "description": "The full or partial URL to the BackendService resource. This URL is used if none of the pathRules or routeRules defined by this PathMatcher are matched. For example, the following are all valid URLs to a BackendService resource: - https://www.googleapis.com/compute/v1/projects/project /global/backendServices/backendService - compute/v1/projects/project/global/backendServices/backendService - global/backendServices/backendService If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. Authorization requires one or more of the following Google IAM permissions on the specified resource default_service: - compute.backendBuckets.use - compute.backendServices.use ", "type": "string" }, "defaultUrlRedirect": { "$ref": "HttpRedirectAction", - "description": "When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, then set either defaultService or defaultRouteAction. Don't set both. Not supported when the URL map is bound to a target gRPC proxy." + "description": "When none of the specified pathRules or routeRules match, the request is redirected to a URL specified by defaultUrlRedirect. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy." }, "description": { "description": "An optional description of this resource. Provide this property when you create the resource.", @@ -64132,15 +65624,15 @@ }, "routeAction": { "$ref": "HttpRouteAction", - "description": "In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If routeAction specifies any weightedBackendServices, service must not be set. Conversely if service is set, routeAction cannot contain any weightedBackendServices. Only one of routeAction or urlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction." + "description": "In response to a matching path, the load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. URL maps for classic Application Load Balancers only support the urlRewrite action within a path rule's routeAction." }, "service": { - "description": "The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if service is specified, routeAction cannot contain any weightedBackendServices. Conversely, if routeAction specifies any weightedBackendServices, service must not be specified. Only one of urlRedirect, service or routeAction.weightedBackendService must be set.", + "description": "The full or partial URL of the backend service resource to which traffic is directed if this rule is matched. If routeAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of urlRedirect, service or routeAction.weightedBackendService can be set.", "type": "string" }, "urlRedirect": { "$ref": "HttpRedirectAction", - "description": "When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. If urlRedirect is specified, service or routeAction must not be set. Not supported when the URL map is bound to a target gRPC proxy." + "description": "When a path pattern is matched, the request is redirected to a URL specified by urlRedirect. Only one of urlRedirect, service or routeAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy." } }, "type": "object" @@ -64154,7 +65646,7 @@ "type": "string" }, "name": { - "description": "The name of a per-instance configuration and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance configuration with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance configconfiguration for a VM instance that either doesn't exist or is not part of the group will result in an error.", + "description": "The name of a per-instance configuration and its corresponding instance. Serves as a merge key during UpdatePerInstanceConfigs operations, that is, if a per-instance configuration with the same name exists then it will be updated, otherwise a new one will be created for the VM instance with the same name. An attempt to create a per-instance configuration for a VM instance that either doesn't exist or is not part of the group will result in an error.", "type": "string" }, "preservedState": { @@ -64384,7 +65876,7 @@ "type": "string" }, "enabledFeatures": { - "description": "Restricted features enabled for use on this project.", + "description": "An optional list of restricted features enabled for use on this project.", "items": { "type": "string" }, @@ -64417,7 +65909,7 @@ }, "usageExportLocation": { "$ref": "UsageExportLocation", - "description": "The naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored." + "description": "An optional naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored." }, "vmDnsSetting": { "description": "[Output Only] Default internal DNS setting used by VMs running in this project.", @@ -64713,6 +66205,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -64749,6 +66242,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -64773,6 +66267,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -65015,6 +66510,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -65051,6 +66547,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -65075,6 +66572,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -65166,6 +66664,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -65202,6 +66701,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -65226,6 +66726,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -65360,6 +66861,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -65396,6 +66898,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -65420,6 +66923,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -65939,6 +67443,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -65975,6 +67480,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -65999,6 +67505,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -66139,6 +67646,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -66175,6 +67683,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -66199,6 +67708,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -66290,6 +67800,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -66326,6 +67837,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -66350,6 +67862,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -66489,6 +68002,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -66525,6 +68039,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -66549,6 +68064,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -66655,6 +68171,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -66691,6 +68208,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -66715,6 +68233,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -66932,6 +68451,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -66968,6 +68488,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -66992,6 +68513,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -67059,6 +68581,19 @@ }, "type": "object" }, + "RegionInstanceGroupManagersResumeInstancesRequest": { + "id": "RegionInstanceGroupManagersResumeInstancesRequest", + "properties": { + "instances": { + "description": "The URLs of one or more instances to resume. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "RegionInstanceGroupManagersSetTargetPoolsRequest": { "id": "RegionInstanceGroupManagersSetTargetPoolsRequest", "properties": { @@ -67087,6 +68622,53 @@ }, "type": "object" }, + "RegionInstanceGroupManagersStartInstancesRequest": { + "id": "RegionInstanceGroupManagersStartInstancesRequest", + "properties": { + "instances": { + "description": "The URLs of one or more instances to start. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "RegionInstanceGroupManagersStopInstancesRequest": { + "id": "RegionInstanceGroupManagersStopInstancesRequest", + "properties": { + "forceStop": { + "description": "If this flag is set to true, the Instance Group Manager will proceed to stop the instances, skipping initialization on them.", + "type": "boolean" + }, + "instances": { + "description": "The URLs of one or more instances to stop. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "RegionInstanceGroupManagersSuspendInstancesRequest": { + "id": "RegionInstanceGroupManagersSuspendInstancesRequest", + "properties": { + "forceSuspend": { + "description": "If this flag is set to true, the Instance Group Manager will proceed to suspend the instances, skipping initialization on them.", + "type": "boolean" + }, + "instances": { + "description": "The URLs of one or more instances to suspend. This can be a full URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME].", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, "RegionInstanceGroupsListInstances": { "id": "RegionInstanceGroupsListInstances", "properties": { @@ -67141,6 +68723,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -67177,6 +68760,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -67201,6 +68785,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -67334,6 +68919,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -67370,6 +68956,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -67394,6 +68981,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -67781,6 +69369,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -67817,6 +69406,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -67841,6 +69431,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -67932,6 +69523,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -67968,6 +69560,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -67992,6 +69585,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -68077,6 +69671,188 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", + "RESOURCE_NOT_DELETED", + "SCHEMA_VALIDATION_IGNORED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNDECLARED_PROPERTIES", + "UNREACHABLE" + ], + "enumDeprecated": [ + false, + false, + false, + false, + false, + false, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false + ], + "enumDescriptions": [ + "Warning about failed cleanup of transient changes made by a failed operation.", + "A link to a deprecated resource was created.", + "When deploying and at least one of the resources has a type marked as deprecated", + "The user created a boot disk that is larger than image size.", + "When deploying and at least one of the resources has a type marked as experimental", + "Warning that is present in an external api call", + "Warning that value of a field has been overridden. Deprecated unused field.", + "The operation involved use of an injected kernel, which is deprecated.", + "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", + "When deploying a deployment with a exceedingly large number of resources", + "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", + "A resource depends on a missing type", + "The route's nextHopIp address is not assigned to an instance on the network.", + "The route's next hop instance cannot ip forward.", + "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", + "The route's nextHopInstance URL refers to an instance that does not exist.", + "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", + "The route's next hop instance does not have a status of RUNNING.", + "Error which is not critical. We decided to continue the process despite the mentioned error.", + "No results are present on a particular list page.", + "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", + "The user attempted to use a resource that requires a TOS they have not accepted.", + "Warning that a resource is in use.", + "One or more of the resources set to auto-delete could not be deleted because they were in use.", + "When a resource schema validation is ignored.", + "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", + "When undeclared properties in the schema are present", + "A given scope cannot be reached." + ], + "type": "string" + }, + "data": { + "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", + "items": { + "properties": { + "key": { + "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", + "type": "string" + }, + "value": { + "description": "[Output Only] A warning data value corresponding to the key.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "message": { + "description": "[Output Only] A human-readable description of the warning code.", + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "ResourceCommitment": { + "description": "Commitment for a particular resource (a Commitment is composed of one or more of these).", + "id": "ResourceCommitment", + "properties": { + "acceleratorType": { + "description": "Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.", + "type": "string" + }, + "amount": { + "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.", + "format": "int64", + "type": "string" + }, + "type": { + "description": "Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR.", + "enum": [ + "ACCELERATOR", + "LOCAL_SSD", + "MEMORY", + "UNSPECIFIED", + "VCPU" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ], + "type": "string" + } + }, + "type": "object" + }, + "ResourceGroupReference": { + "id": "ResourceGroupReference", + "properties": { + "group": { + "description": "A URI referencing one of the instance groups or network endpoint groups listed in the backend service.", + "type": "string" + } + }, + "type": "object" + }, + "ResourcePoliciesScopedList": { + "id": "ResourcePoliciesScopedList", + "properties": { + "resourcePolicies": { + "description": "A list of resourcePolicies contained in this scope.", + "items": { + "$ref": "ResourcePolicy" + }, + "type": "array" + }, + "warning": { + "description": "Informational warning which replaces the list of resourcePolicies when the list is empty.", + "properties": { + "code": { + "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", + "enum": [ + "CLEANUP_FAILED", + "DEPRECATED_RESOURCE_USED", + "DEPRECATED_TYPE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "EXPERIMENTAL_TYPE_USED", + "EXTERNAL_API_WARNING", + "FIELD_VALUE_OVERRIDEN", + "INJECTED_KERNELS_DEPRECATED", + "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", + "LARGE_DEPLOYMENT_WARNING", + "LIST_OVERHEAD_QUOTA_EXCEED", + "MISSING_TYPE_DEPENDENCY", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -68113,183 +69889,6 @@ false, false, false, - false - ], - "enumDescriptions": [ - "Warning about failed cleanup of transient changes made by a failed operation.", - "A link to a deprecated resource was created.", - "When deploying and at least one of the resources has a type marked as deprecated", - "The user created a boot disk that is larger than image size.", - "When deploying and at least one of the resources has a type marked as experimental", - "Warning that is present in an external api call", - "Warning that value of a field has been overridden. Deprecated unused field.", - "The operation involved use of an injected kernel, which is deprecated.", - "A WEIGHTED_MAGLEV backend service is associated with a health check that is not of type HTTP/HTTPS/HTTP2.", - "When deploying a deployment with a exceedingly large number of resources", - "Resource can't be retrieved due to list overhead quota exceed which captures the amount of resources filtered out by user-defined list filter.", - "A resource depends on a missing type", - "The route's nextHopIp address is not assigned to an instance on the network.", - "The route's next hop instance cannot ip forward.", - "The route's nextHopInstance URL refers to an instance that does not have an ipv6 interface on the same network as the route.", - "The route's nextHopInstance URL refers to an instance that does not exist.", - "The route's nextHopInstance URL refers to an instance that is not on the same network as the route.", - "The route's next hop instance does not have a status of RUNNING.", - "Error which is not critical. We decided to continue the process despite the mentioned error.", - "No results are present on a particular list page.", - "Success is reported, but some results may be missing due to errors", - "The user attempted to use a resource that requires a TOS they have not accepted.", - "Warning that a resource is in use.", - "One or more of the resources set to auto-delete could not be deleted because they were in use.", - "When a resource schema validation is ignored.", - "Instance template used in instance group manager is valid as such, but its application does not make a lot of sense, because it allows only single instance in instance group.", - "When undeclared properties in the schema are present", - "A given scope cannot be reached." - ], - "type": "string" - }, - "data": { - "description": "[Output Only] Metadata about this warning in key: value format. For example: \"data\": [ { \"key\": \"scope\", \"value\": \"zones/us-east1-d\" } ", - "items": { - "properties": { - "key": { - "description": "[Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).", - "type": "string" - }, - "value": { - "description": "[Output Only] A warning data value corresponding to the key.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - }, - "message": { - "description": "[Output Only] A human-readable description of the warning code.", - "type": "string" - } - }, - "type": "object" - } - }, - "type": "object" - }, - "ResourceCommitment": { - "description": "Commitment for a particular resource (a Commitment is composed of one or more of these).", - "id": "ResourceCommitment", - "properties": { - "acceleratorType": { - "description": "Name of the accelerator type resource. Applicable only when the type is ACCELERATOR.", - "type": "string" - }, - "amount": { - "description": "The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU.", - "format": "int64", - "type": "string" - }, - "type": { - "description": "Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR.", - "enum": [ - "ACCELERATOR", - "LOCAL_SSD", - "MEMORY", - "UNSPECIFIED", - "VCPU" - ], - "enumDescriptions": [ - "", - "", - "", - "", - "" - ], - "type": "string" - } - }, - "type": "object" - }, - "ResourceGroupReference": { - "id": "ResourceGroupReference", - "properties": { - "group": { - "description": "A URI referencing one of the instance groups or network endpoint groups listed in the backend service.", - "type": "string" - } - }, - "type": "object" - }, - "ResourcePoliciesScopedList": { - "id": "ResourcePoliciesScopedList", - "properties": { - "resourcePolicies": { - "description": "A list of resourcePolicies contained in this scope.", - "items": { - "$ref": "ResourcePolicy" - }, - "type": "array" - }, - "warning": { - "description": "Informational warning which replaces the list of resourcePolicies when the list is empty.", - "properties": { - "code": { - "description": "[Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.", - "enum": [ - "CLEANUP_FAILED", - "DEPRECATED_RESOURCE_USED", - "DEPRECATED_TYPE_USED", - "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", - "EXPERIMENTAL_TYPE_USED", - "EXTERNAL_API_WARNING", - "FIELD_VALUE_OVERRIDEN", - "INJECTED_KERNELS_DEPRECATED", - "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB", - "LARGE_DEPLOYMENT_WARNING", - "LIST_OVERHEAD_QUOTA_EXCEED", - "MISSING_TYPE_DEPENDENCY", - "NEXT_HOP_ADDRESS_NOT_ASSIGNED", - "NEXT_HOP_CANNOT_IP_FORWARD", - "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE", - "NEXT_HOP_INSTANCE_NOT_FOUND", - "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", - "NEXT_HOP_NOT_RUNNING", - "NOT_CRITICAL_ERROR", - "NO_RESULTS_ON_PAGE", - "PARTIAL_SUCCESS", - "REQUIRED_TOS_AGREEMENT", - "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", - "RESOURCE_NOT_DELETED", - "SCHEMA_VALIDATION_IGNORED", - "SINGLE_INSTANCE_PROPERTY_TEMPLATE", - "UNDECLARED_PROPERTIES", - "UNREACHABLE" - ], - "enumDeprecated": [ - false, - false, - false, - false, - false, - false, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, false, false ], @@ -68315,6 +69914,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -68497,6 +70097,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -68533,6 +70134,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -68557,6 +70159,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -68764,6 +70367,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -68800,6 +70404,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -68824,6 +70429,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -69033,7 +70639,7 @@ "id": "ResourceStatus", "properties": { "physicalHost": { - "description": "[Output Only] An opaque ID of the host on which the VM is running.", + "description": "[Output Only] The precise location of your instance within the zone's data center, including the block, sub-block, and host. The field is formatted as follows: blockId/subBlockId/hostId.", "type": "string" }, "scheduling": { @@ -69129,14 +70735,38 @@ "description": "The URL to an instance that should handle matching packets. You can specify this as a full or partial URL. For example: https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/", "type": "string" }, + "nextHopInterRegionCost": { + "description": "[Output only] Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions.", + "format": "uint32", + "type": "integer" + }, "nextHopIp": { "description": "The network IP address of an instance that should handle matching packets. Both IPv6 address and IPv4 addresses are supported. Must specify an IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in RFC 4291 format (e.g. 2001:db8::2d9:51:0:0 or 2001:db8:0:0:2d9:51:0:0). IPv6 addresses will be displayed using RFC 5952 compressed format (e.g. 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address.", "type": "string" }, + "nextHopMed": { + "description": "[Output Only] Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network.", + "format": "uint32", + "type": "integer" + }, "nextHopNetwork": { "description": "The URL of the local network if it should handle matching packets.", "type": "string" }, + "nextHopOrigin": { + "description": "[Output Only] Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE.", + "enum": [ + "EGP", + "IGP", + "INCOMPLETE" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "type": "string" + }, "nextHopPeering": { "description": "[Output Only] The network peering name that should handle matching packets, which should conform to RFC1035.", "type": "string" @@ -69231,6 +70861,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -69267,6 +70898,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -69291,6 +70923,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -69415,6 +71048,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -69451,6 +71085,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -69475,6 +71110,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -69679,6 +71315,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -69715,6 +71352,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -69739,6 +71377,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -70154,6 +71793,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -70190,6 +71830,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -70214,6 +71855,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -70857,6 +72499,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -70893,6 +72536,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -70917,6 +72561,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -71406,6 +73051,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -71442,6 +73088,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -71466,6 +73113,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -71549,6 +73197,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -71585,6 +73234,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -71609,6 +73259,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -71987,6 +73638,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -72023,6 +73675,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -72047,6 +73700,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -72439,7 +74093,7 @@ "type": "string" }, "enforceOnKey": { - "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKey\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. ", + "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKey\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. ", "enum": [ "ALL", "HTTP_COOKIE", @@ -72449,6 +74103,7 @@ "REGION_CODE", "SNI", "TLS_JA3_FINGERPRINT", + "TLS_JA4_FINGERPRINT", "USER_IP", "XFF_IP" ], @@ -72462,6 +74117,7 @@ "", "", "", + "", "" ], "type": "string" @@ -72500,7 +74156,7 @@ "type": "string" }, "enforceOnKeyType": { - "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKeyConfigs\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. ", + "description": "Determines the key to enforce the rate_limit_threshold on. Possible values are: - ALL: A single rate limit threshold is applied to all the requests matching this rule. This is the default value if \"enforceOnKeyConfigs\" is not configured. - IP: The source IP address of the request is the key. Each IP has this limit enforced separately. - HTTP_HEADER: The value of the HTTP header whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the header value. If no such header is present in the request, the key type defaults to ALL. - XFF_IP: The first IP address (i.e. the originating client IP address) specified in the list of IPs under X-Forwarded-For HTTP header. If no such header is present or the value is not a valid IP, the key defaults to the source IP address of the request i.e. key type IP. - HTTP_COOKIE: The value of the HTTP cookie whose name is configured under \"enforceOnKeyName\". The key value is truncated to the first 128 bytes of the cookie value. If no such cookie is present in the request, the key type defaults to ALL. - HTTP_PATH: The URL path of the HTTP request. The key value is truncated to the first 128 bytes. - SNI: Server name indication in the TLS session of the HTTPS request. The key value is truncated to the first 128 bytes. The key type defaults to ALL on a HTTP session. - REGION_CODE: The country/region from which the request originates. - TLS_JA3_FINGERPRINT: JA3 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. - USER_IP: The IP address of the originating client, which is resolved based on \"userIpRequestHeaders\" configured with the security policy. If there is no \"userIpRequestHeaders\" configuration or an IP address cannot be resolved from it, the key type defaults to IP. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. ", "enum": [ "ALL", "HTTP_COOKIE", @@ -72510,6 +74166,7 @@ "REGION_CODE", "SNI", "TLS_JA3_FINGERPRINT", + "TLS_JA4_FINGERPRINT", "USER_IP", "XFF_IP" ], @@ -72523,6 +74180,7 @@ "", "", "", + "", "" ], "type": "string" @@ -72883,6 +74541,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -72919,6 +74578,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -72943,6 +74603,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -73098,6 +74759,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -73134,6 +74796,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -73158,6 +74821,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -73232,6 +74896,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -73268,6 +74933,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -73292,6 +74958,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -73775,6 +75442,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -73811,6 +75479,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -73835,6 +75504,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -74179,6 +75849,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -74215,6 +75886,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -74239,6 +75911,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -74331,6 +76004,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -74367,6 +76041,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -74391,6 +76066,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -74539,6 +76215,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -74575,6 +76252,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -74599,6 +76277,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -74701,6 +76380,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -74737,6 +76417,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -74761,6 +76442,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -74852,6 +76534,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -74888,6 +76571,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -74912,6 +76596,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -74998,6 +76683,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -75034,6 +76720,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -75058,6 +76745,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -75207,6 +76895,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -75243,6 +76932,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -75267,6 +76957,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -75616,6 +77307,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -75652,6 +77344,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -75676,6 +77369,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -75854,6 +77548,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -75890,6 +77585,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -75914,6 +77610,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -76015,6 +77712,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -76051,6 +77749,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -76075,6 +77774,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -76310,6 +78010,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -76346,6 +78047,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -76370,6 +78072,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -76462,6 +78165,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -76498,6 +78202,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -76522,6 +78227,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -76596,6 +78302,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -76632,6 +78339,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -76656,6 +78364,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -76730,6 +78439,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -76766,6 +78476,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -76790,6 +78501,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -76922,10 +78634,11 @@ "type": "string" }, "purpose": { - "description": "The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY.", + "description": "The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY.", "enum": [ "GLOBAL_MANAGED_PROXY", "INTERNAL_HTTPS_LOAD_BALANCER", + "PEER_MIGRATION", "PRIVATE", "PRIVATE_NAT", "PRIVATE_RFC_1918", @@ -76935,6 +78648,7 @@ "enumDescriptions": [ "Subnet reserved for Global Envoy-based Load Balancing.", "Subnet reserved for Internal HTTP(S) Load Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY instead.", + "Subnetwork will be used for Migration from one peered VPC to another. (a transient state of subnetwork while migrating resources from one project to another).", "Regular user created or automatically created subnet.", "Subnetwork used as source range for Private NAT Gateways.", "Regular user created or automatically created subnet.", @@ -77065,6 +78779,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -77101,6 +78816,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -77125,6 +78841,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -77217,6 +78934,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -77253,6 +78971,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -77277,6 +78996,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -77441,6 +79161,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -77477,6 +79198,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -77501,6 +79223,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -77744,6 +79467,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -77780,6 +79504,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -77804,6 +79529,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -77878,6 +79604,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -77914,6 +79641,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -77938,6 +79666,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -78124,6 +79853,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -78160,6 +79890,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -78184,6 +79915,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -78258,6 +79990,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -78294,6 +80027,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -78318,6 +80052,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -78399,7 +80134,7 @@ "type": "object" }, "TargetHttpsProxy": { - "description": "Represents a Target HTTPS Proxy resource. Google Compute Engine has two Target HTTPS Proxy resources: * [Global](/compute/docs/reference/rest/v1/targetHttpsProxies) * [Regional](/compute/docs/reference/rest/v1/regionTargetHttpsProxies) A target HTTPS proxy is a component of GCP HTTPS load balancers. * targetHttpProxies are used by global external Application Load Balancers, classic Application Load Balancers, cross-region internal Application Load Balancers, and Traffic Director. * regionTargetHttpProxies are used by regional internal Application Load Balancers and regional external Application Load Balancers. Forwarding rules reference a target HTTPS proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies and Forwarding rule concepts.", + "description": "Represents a Target HTTPS Proxy resource. Google Compute Engine has two Target HTTPS Proxy resources: * [Global](/compute/docs/reference/rest/v1/targetHttpsProxies) * [Regional](/compute/docs/reference/rest/v1/regionTargetHttpsProxies) A target HTTPS proxy is a component of Google Cloud HTTPS load balancers. * targetHttpProxies are used by global external Application Load Balancers, classic Application Load Balancers, cross-region internal Application Load Balancers, and Traffic Director. * regionTargetHttpProxies are used by regional internal Application Load Balancers and regional external Application Load Balancers. Forwarding rules reference a target HTTPS proxy, and the target proxy then references a URL map. For more information, read Using Target Proxies and Forwarding rule concepts.", "id": "TargetHttpsProxy", "properties": { "authorizationPolicy": { @@ -78489,12 +80224,14 @@ "enum": [ "DISABLED", "PERMISSIVE", - "STRICT" + "STRICT", + "UNRESTRICTED" ], "enumDescriptions": [ "TLS 1.3 Early Data is not advertised, and any (invalid) attempts to send Early Data will be rejected by closing the connection.", "This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE). This mode does not enforce any other limitations for requests with Early Data. The application owner should validate that Early Data is acceptable for a given request path.", - "This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE) without query parameters. Requests that send Early Data with non-idempotent HTTP methods or with query parameters will be rejected with a HTTP 425." + "This enables TLS 1.3 0-RTT, and only allows Early Data to be included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE) without query parameters. Requests that send Early Data with non-idempotent HTTP methods or with query parameters will be rejected with a HTTP 425.", + "This enables TLS 1.3 Early Data for requests with any HTTP method including non-idempotent methods list POST. This mode does not enforce any other limitations. This may be valuable for gRPC use cases. However, we do not recommend this method unless you have evaluated your security stance and mitigated the risk of replay attacks using other mechanisms." ], "type": "string" }, @@ -78567,6 +80304,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -78603,6 +80341,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -78627,6 +80366,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -78719,6 +80459,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -78755,6 +80496,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -78779,6 +80521,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -78938,6 +80681,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -78974,6 +80718,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -78998,6 +80743,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -79090,6 +80836,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -79126,6 +80873,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -79150,6 +80898,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -79224,6 +80973,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -79260,6 +81010,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -79284,6 +81035,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -79474,6 +81226,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -79510,6 +81263,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -79534,6 +81288,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -79643,6 +81398,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -79679,6 +81435,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -79703,6 +81460,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -79829,6 +81587,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -79865,6 +81624,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -79889,6 +81649,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -80106,6 +81867,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -80142,6 +81904,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -80166,6 +81929,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -80240,6 +82004,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -80276,6 +82041,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -80300,6 +82066,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -80485,6 +82252,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -80521,6 +82289,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -80545,6 +82314,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -80637,6 +82407,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -80673,6 +82444,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -80697,6 +82469,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -80890,6 +82663,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -80926,6 +82700,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -80950,6 +82725,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -81042,6 +82818,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -81078,6 +82855,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -81102,6 +82880,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -81176,6 +82955,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -81212,6 +82992,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -81236,6 +83017,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -81424,15 +83206,15 @@ }, "defaultRouteAction": { "$ref": "HttpRouteAction", - "description": "defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. If defaultRouteAction specifies any weightedBackendServices, defaultService must not be set. Conversely if defaultService is set, defaultRouteAction cannot contain any weightedBackendServices. Only one of defaultRouteAction or defaultUrlRedirect must be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true." + "description": "defaultRouteAction takes effect when none of the hostRules match. The load balancer performs advanced routing actions, such as URL rewrites and header transformations, before forwarding the request to the selected backend. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. URL maps for classic Application Load Balancers only support the urlRewrite action within defaultRouteAction. defaultRouteAction has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true." }, "defaultService": { - "description": "The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. However, if defaultService is specified, defaultRouteAction cannot contain any defaultRouteAction.weightedBackendServices. Conversely, if defaultRouteAction specifies any defaultRouteAction.weightedBackendServices, defaultService must not be specified. If defaultService is specified, then set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService Don't set both. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.", + "description": "The full or partial URL of the defaultService resource to which traffic is directed if none of the hostRules match. If defaultRouteAction is also specified, advanced routing actions, such as URL rewrites, take effect before sending the request to the backend. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. defaultService has no effect when the URL map is bound to a target gRPC proxy that has the validateForProxyless field set to true.", "type": "string" }, "defaultUrlRedirect": { "$ref": "HttpRedirectAction", - "description": "When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. If defaultUrlRedirect is specified, defaultService or defaultRouteAction must not be set. Not supported when the URL map is bound to a target gRPC proxy." + "description": "When none of the specified hostRules match, the request is redirected to a URL specified by defaultUrlRedirect. Only one of defaultUrlRedirect, defaultService or defaultRouteAction.weightedBackendService can be set. Not supported when the URL map is bound to a target gRPC proxy." }, "description": { "description": "An optional description of this resource. Provide this property when you create the resource.", @@ -81549,6 +83331,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -81585,6 +83368,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -81609,6 +83393,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -81798,6 +83583,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -81834,6 +83620,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -81858,6 +83645,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -81932,6 +83720,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -81968,6 +83757,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -81992,6 +83782,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -82117,10 +83908,11 @@ "type": "string" }, "purpose": { - "description": "The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY.", + "description": "The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY.", "enum": [ "GLOBAL_MANAGED_PROXY", "INTERNAL_HTTPS_LOAD_BALANCER", + "PEER_MIGRATION", "PRIVATE", "PRIVATE_NAT", "PRIVATE_RFC_1918", @@ -82130,6 +83922,7 @@ "enumDescriptions": [ "Subnet reserved for Global Envoy-based Load Balancing.", "Subnet reserved for Internal HTTP(S) Load Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY instead.", + "Subnetwork will be used for Migration from one peered VPC to another. (a transient state of subnetwork while migrating resources from one project to another).", "Regular user created or automatically created subnet.", "Subnetwork used as source range for Private NAT Gateways.", "Regular user created or automatically created subnet.", @@ -82247,6 +84040,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -82283,6 +84077,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -82307,6 +84102,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -82513,6 +84309,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -82549,6 +84346,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -82573,6 +84371,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -82769,6 +84568,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -82805,6 +84605,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -82829,6 +84630,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -82921,6 +84723,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -82957,6 +84760,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -82981,6 +84785,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -83177,6 +84982,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -83213,6 +85019,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -83237,6 +85044,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -83490,6 +85298,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -83526,6 +85335,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -83550,6 +85360,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -83642,6 +85453,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -83678,6 +85490,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -83702,6 +85515,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -83776,6 +85590,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -83812,6 +85627,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -83836,6 +85652,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -83986,6 +85803,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -84022,6 +85840,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -84046,6 +85865,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", @@ -84225,6 +86045,7 @@ "NOT_CRITICAL_ERROR", "NO_RESULTS_ON_PAGE", "PARTIAL_SUCCESS", + "QUOTA_INFO_UNAVAILABLE", "REQUIRED_TOS_AGREEMENT", "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING", "RESOURCE_NOT_DELETED", @@ -84261,6 +86082,7 @@ false, false, false, + false, false ], "enumDescriptions": [ @@ -84285,6 +86107,7 @@ "Error which is not critical. We decided to continue the process despite the mentioned error.", "No results are present on a particular list page.", "Success is reported, but some results may be missing due to errors", + "Quota information is not available to client requests (e.g: regions.list).", "The user attempted to use a resource that requires a TOS they have not accepted.", "Warning that a resource is in use.", "One or more of the resources set to auto-delete could not be deleted because they were in use.", diff --git a/vendor/google.golang.org/api/compute/v1/compute-gen.go b/vendor/google.golang.org/api/compute/v1/compute-gen.go index b437b422fed30..678061a207f75 100644 --- a/vendor/google.golang.org/api/compute/v1/compute-gen.go +++ b/vendor/google.golang.org/api/compute/v1/compute-gen.go @@ -203,6 +203,7 @@ func New(client *http.Client) (*Service, error) { s.NetworkEdgeSecurityServices = NewNetworkEdgeSecurityServicesService(s) s.NetworkEndpointGroups = NewNetworkEndpointGroupsService(s) s.NetworkFirewallPolicies = NewNetworkFirewallPoliciesService(s) + s.NetworkProfiles = NewNetworkProfilesService(s) s.Networks = NewNetworksService(s) s.NodeGroups = NewNodeGroupsService(s) s.NodeTemplates = NewNodeTemplatesService(s) @@ -352,6 +353,8 @@ type Service struct { NetworkFirewallPolicies *NetworkFirewallPoliciesService + NetworkProfiles *NetworkProfilesService + Networks *NetworksService NodeGroups *NodeGroupsService @@ -847,6 +850,15 @@ type NetworkFirewallPoliciesService struct { s *Service } +func NewNetworkProfilesService(s *Service) *NetworkProfilesService { + rs := &NetworkProfilesService{s: s} + return rs +} + +type NetworkProfilesService struct { + s *Service +} + func NewNetworksService(s *Service) *NetworksService { rs := &NetworksService{s: s} return rs @@ -1587,6 +1599,8 @@ type AcceleratorTypeAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -1741,6 +1755,8 @@ type AcceleratorTypeListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -1881,6 +1897,8 @@ type AcceleratorTypesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -2286,6 +2304,8 @@ type AddressAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -2440,6 +2460,8 @@ type AddressListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -2579,6 +2601,8 @@ type AddressesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -3500,6 +3524,8 @@ type AutoscalerAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -3654,6 +3680,8 @@ type AutoscalerListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -3894,6 +3922,8 @@ type AutoscalersScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -4520,7 +4550,8 @@ type BackendBucketCdnPolicy struct { // identifiable) content. CACHE_ALL_STATIC Automatically cache static content, // including common image formats, media (video and audio), and web assets // (JavaScript and CSS). Requests and responses that are marked as uncacheable, - // as well as dynamic content (including HTML), will not be cached. + // as well as dynamic content (including HTML), will not be cached. If no value + // is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. // // Possible values: // "CACHE_ALL_STATIC" - Automatically cache static content, including common @@ -4800,6 +4831,8 @@ type BackendBucketListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -5382,6 +5415,8 @@ type BackendServiceAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -5470,7 +5505,8 @@ type BackendServiceCdnPolicy struct { // identifiable) content. CACHE_ALL_STATIC Automatically cache static content, // including common image formats, media (video and audio), and web assets // (JavaScript and CSS). Requests and responses that are marked as uncacheable, - // as well as dynamic content (including HTML), will not be cached. + // as well as dynamic content (including HTML), will not be cached. If no value + // is provided for cdnPolicy.cacheMode, it defaults to CACHE_ALL_STATIC. // // Possible values: // "CACHE_ALL_STATIC" - Automatically cache static content, including common @@ -5956,6 +5992,8 @@ type BackendServiceListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -6112,6 +6150,8 @@ type BackendServiceListUsableWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -6468,6 +6508,8 @@ type BackendServicesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -7224,6 +7266,9 @@ type Commitment struct { // "GRAPHICS_OPTIMIZED" // "MEMORY_OPTIMIZED" // "MEMORY_OPTIMIZED_M3" + // "MEMORY_OPTIMIZED_X4_16TB" + // "MEMORY_OPTIMIZED_X4_24TB" + // "MEMORY_OPTIMIZED_X4_32TB" // "STORAGE_OPTIMIZED_Z3" // "TYPE_UNSPECIFIED" Type string `json:"type,omitempty"` @@ -7337,6 +7382,8 @@ type CommitmentAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -7491,6 +7538,8 @@ type CommitmentListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -7657,6 +7706,8 @@ type CommitmentsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -8493,6 +8544,8 @@ type DiskAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -8770,6 +8823,8 @@ type DiskListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -9089,6 +9144,8 @@ type DiskTypeAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -9243,6 +9300,8 @@ type DiskTypeListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -9382,6 +9441,8 @@ type DiskTypesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -9585,6 +9646,8 @@ type DisksScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -10005,6 +10068,8 @@ type ExchangedPeeringRoutesListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -10341,6 +10406,8 @@ type ExternalVpnGatewayListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -10719,6 +10786,8 @@ type FirewallListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -11053,6 +11122,8 @@ type FirewallPolicyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -11774,6 +11845,8 @@ type ForwardingRuleAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -11927,6 +12000,8 @@ type ForwardingRuleListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -12119,6 +12194,8 @@ type ForwardingRulesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -12952,6 +13029,8 @@ type HealthCheckListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -13277,6 +13356,8 @@ type HealthCheckServicesListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -13432,6 +13513,8 @@ type HealthChecksAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -13571,6 +13654,8 @@ type HealthChecksScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -14249,6 +14334,8 @@ type HttpHealthCheckListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -14615,26 +14702,21 @@ type HttpRouteRule struct { Priority int64 `json:"priority,omitempty"` // RouteAction: In response to a matching matchRule, the load balancer performs // advanced routing actions, such as URL rewrites and header transformations, - // before forwarding the request to the selected backend. If routeAction - // specifies any weightedBackendServices, service must not be set. Conversely - // if service is set, routeAction cannot contain any weightedBackendServices. - // Only one of urlRedirect, service or routeAction.weightedBackendService must - // be set. URL maps for classic Application Load Balancers only support the - // urlRewrite action within a route rule's routeAction. + // before forwarding the request to the selected backend. Only one of + // urlRedirect, service or routeAction.weightedBackendService can be set. URL + // maps for classic Application Load Balancers only support the urlRewrite + // action within a route rule's routeAction. RouteAction *HttpRouteAction `json:"routeAction,omitempty"` // Service: The full or partial URL of the backend service resource to which // traffic is directed if this rule is matched. If routeAction is also // specified, advanced routing actions, such as URL rewrites, take effect - // before sending the request to the backend. However, if service is specified, - // routeAction cannot contain any weightedBackendServices. Conversely, if - // routeAction specifies any weightedBackendServices, service must not be - // specified. Only one of urlRedirect, service or - // routeAction.weightedBackendService must be set. + // before sending the request to the backend. Only one of urlRedirect, service + // or routeAction.weightedBackendService can be set. Service string `json:"service,omitempty"` // UrlRedirect: When this rule is matched, the request is redirected to a URL - // specified by urlRedirect. If urlRedirect is specified, service or - // routeAction must not be set. Not supported when the URL map is bound to a - // target gRPC proxy. + // specified by urlRedirect. Only one of urlRedirect, service or + // routeAction.weightedBackendService can be set. Not supported when the URL + // map is bound to a target gRPC proxy. UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomErrorResponsePolicy") // to unconditionally include in API requests. By default, fields with empty or @@ -14888,6 +14970,8 @@ type HttpsHealthCheckListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -15282,6 +15366,8 @@ type ImageListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -15692,6 +15778,8 @@ type InstanceAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -15978,6 +16066,8 @@ type InstanceGroupAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -16132,6 +16222,8 @@ type InstanceGroupListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -16287,6 +16379,8 @@ type InstanceGroupManager struct { // SelfLink: [Output Only] The URL for this managed instance group. The server // defines this URL. SelfLink string `json:"selfLink,omitempty"` + // StandbyPolicy: Standby policy for stopped and suspended instances. + StandbyPolicy *InstanceGroupManagerStandbyPolicy `json:"standbyPolicy,omitempty"` // StatefulPolicy: Stateful configuration for this Instanced Group Manager StatefulPolicy *StatefulPolicy `json:"statefulPolicy,omitempty"` // Status: [Output Only] The status of this managed instance group. @@ -16300,6 +16394,17 @@ type InstanceGroupManager struct { // deleteInstances or abandonInstances methods. Resizing the group also changes // this number. TargetSize int64 `json:"targetSize,omitempty"` + // TargetStoppedSize: The target number of stopped instances for this managed + // instance group. This number changes when you: - Stop instance using the + // stopInstances method or start instances using the startInstances method. - + // Manually change the targetStoppedSize using the update method. + TargetStoppedSize int64 `json:"targetStoppedSize,omitempty"` + // TargetSuspendedSize: The target number of suspended instances for this + // managed instance group. This number changes when you: - Suspend instance + // using the suspendInstances method or resume instances using the + // resumeInstances method. - Manually change the targetSuspendedSize using the + // update method. + TargetSuspendedSize int64 `json:"targetSuspendedSize,omitempty"` // UpdatePolicy: The update policy for this managed instance group. UpdatePolicy *InstanceGroupManagerUpdatePolicy `json:"updatePolicy,omitempty"` // Versions: Specifies the instance templates used by this managed instance @@ -16495,6 +16600,8 @@ type InstanceGroupManagerAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -16796,6 +16903,8 @@ type InstanceGroupManagerListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -17239,6 +17348,8 @@ type InstanceGroupManagerResizeRequestsListResponseWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -17306,6 +17417,40 @@ func (s InstanceGroupManagerResizeRequestsListResponseWarningData) MarshalJSON() return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +type InstanceGroupManagerStandbyPolicy struct { + // InitialDelaySec: Specifies the number of seconds that the MIG should wait to + // suspend or stop a VM after that VM was created. The initial delay gives the + // initialization script the time to prepare your VM for a quick scale out. The + // value of initial delay must be between 0 and 3600 seconds. The default value + // is 0. + InitialDelaySec int64 `json:"initialDelaySec,omitempty"` + // Mode: Defines how a MIG resumes or starts VMs from a standby pool when the + // group scales out. The default mode is `MANUAL`. + // + // Possible values: + // "MANUAL" - MIG does not automatically resume or start VMs in the standby + // pool when the group scales out. + // "SCALE_OUT_POOL" - MIG automatically resumes or starts VMs in the standby + // pool when the group scales out, and replenishes the standby pool afterwards. + Mode string `json:"mode,omitempty"` + // ForceSendFields is a list of field names (e.g. "InitialDelaySec") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "InitialDelaySec") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstanceGroupManagerStandbyPolicy) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagerStandbyPolicy + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + type InstanceGroupManagerStatus struct { // AllInstancesConfig: [Output only] Status of all-instances configuration on // the group. @@ -17890,6 +18035,8 @@ type InstanceGroupManagersListPerInstanceConfigsRespWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -18003,6 +18150,28 @@ func (s InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, er return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +type InstanceGroupManagersResumeInstancesRequest struct { + // Instances: The URLs of one or more instances to resume. This can be a full + // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Instances") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstanceGroupManagersResumeInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagersResumeInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + type InstanceGroupManagersScopedList struct { // InstanceGroupManagers: [Output Only] The list of managed instance groups // that are contained in the specified project and zone. @@ -18076,6 +18245,8 @@ type InstanceGroupManagersScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -18199,6 +18370,78 @@ func (s InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +type InstanceGroupManagersStartInstancesRequest struct { + // Instances: The URLs of one or more instances to start. This can be a full + // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Instances") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstanceGroupManagersStartInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagersStartInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type InstanceGroupManagersStopInstancesRequest struct { + // ForceStop: If this flag is set to true, the Instance Group Manager will + // proceed to stop the instances, skipping initialization on them. + ForceStop bool `json:"forceStop,omitempty"` + // Instances: The URLs of one or more instances to stop. This can be a full URL + // or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "ForceStop") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ForceStop") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstanceGroupManagersStopInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagersStopInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type InstanceGroupManagersSuspendInstancesRequest struct { + // ForceSuspend: If this flag is set to true, the Instance Group Manager will + // proceed to suspend the instances, skipping initialization on them. + ForceSuspend bool `json:"forceSuspend,omitempty"` + // Instances: The URLs of one or more instances to suspend. This can be a full + // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "ForceSuspend") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ForceSuspend") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s InstanceGroupManagersSuspendInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod InstanceGroupManagersSuspendInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // InstanceGroupManagersUpdatePerInstanceConfigsReq: // InstanceGroupManagers.updatePerInstanceConfigs type InstanceGroupManagersUpdatePerInstanceConfigsReq struct { @@ -18332,6 +18575,8 @@ type InstanceGroupsListInstancesWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -18522,6 +18767,8 @@ type InstanceGroupsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -18705,6 +18952,8 @@ type InstanceListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -18859,6 +19108,8 @@ type InstanceListReferrersWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -19490,6 +19741,8 @@ type InstanceTemplateAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -19644,6 +19897,8 @@ type InstanceTemplateListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -19784,6 +20039,8 @@ type InstanceTemplatesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -20100,6 +20357,8 @@ type InstancesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -20558,6 +20817,8 @@ type InstantSnapshotAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -20711,6 +20972,8 @@ type InstantSnapshotListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -20872,6 +21135,8 @@ type InstantSnapshotsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -21544,6 +21809,8 @@ type InterconnectAttachmentAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -21763,6 +22030,8 @@ type InterconnectAttachmentListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -21961,6 +22230,8 @@ type InterconnectAttachmentsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -22383,6 +22654,8 @@ type InterconnectListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -22464,7 +22737,8 @@ type InterconnectLocation struct { // "zone1" or "zone2". AvailabilityZone string `json:"availabilityZone,omitempty"` // AvailableFeatures: [Output only] List of features available at this - // InterconnectLocation, which can take one of the following values: - MACSEC + // InterconnectLocation, which can take one of the following values: - + // IF_MACSEC // // Possible values: // "IF_MACSEC" - Media Access Control security (MACsec) @@ -22648,6 +22922,8 @@ type InterconnectLocationListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -23240,6 +23516,8 @@ type InterconnectRemoteLocationListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -23404,7 +23682,8 @@ type License struct { LicenseCode uint64 `json:"licenseCode,omitempty,string"` // Name: Name of the resource. The name must be 1-63 characters long and comply // with RFC1035. - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` + // ResourceRequirements: [Input Only] Deprecated. ResourceRequirements *LicenseResourceRequirements `json:"resourceRequirements,omitempty"` // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` @@ -23544,11 +23823,11 @@ func (s LicenseResourceCommitment) MarshalJSON() ([]byte, error) { } type LicenseResourceRequirements struct { - // MinGuestCpuCount: Minimum number of guest cpus required to use the Instance. - // Enforced at Instance creation and Instance start. + // MinGuestCpuCount: [Input Only] Deprecated. This field no longer reflects the + // minimum number of guest cpus required to use the Instance. MinGuestCpuCount int64 `json:"minGuestCpuCount,omitempty"` - // MinMemoryMb: Minimum memory required to use the Instance. Enforced at - // Instance creation and Instance start. + // MinMemoryMb: [Input Only] Deprecated. This field no longer reflects the + // minimum memory required to use the Instance. MinMemoryMb int64 `json:"minMemoryMb,omitempty"` // ForceSendFields is a list of field names (e.g. "MinGuestCpuCount") to // unconditionally include in API requests. By default, fields with empty or @@ -23651,6 +23930,8 @@ type LicensesListResponseWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -24057,6 +24338,8 @@ type MachineImageListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -24334,6 +24617,8 @@ type MachineTypeAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -24488,6 +24773,8 @@ type MachineTypeListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -24627,6 +24914,8 @@ type MachineTypesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -25310,6 +25599,12 @@ type Network struct { // "AFTER_CLASSIC_FIREWALL" // "BEFORE_CLASSIC_FIREWALL" NetworkFirewallPolicyEnforcementOrder string `json:"networkFirewallPolicyEnforcementOrder,omitempty"` + // NetworkProfile: A full or partial URL of the network profile to apply to + // this network. This field can be set only at resource creation time. For + // example, the following are valid URLs: - + // https://www.googleapis.com/compute/{api_version}/projects/{project_id}/global/networkProfiles/{network_profile_name} + // - projects/{project_id}/global/networkProfiles/{network_profile_name} + NetworkProfile string `json:"networkProfile,omitempty"` // Peerings: [Output Only] A list of network peerings for the resource. Peerings []*NetworkPeering `json:"peerings,omitempty"` // RoutingConfig: The network-level routing configuration for this network. @@ -25511,6 +25806,8 @@ type NetworkAttachmentAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -25715,6 +26012,8 @@ type NetworkAttachmentListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -25854,6 +26153,8 @@ type NetworkAttachmentsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -26075,6 +26376,8 @@ type NetworkEdgeSecurityServiceAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -26215,6 +26518,8 @@ type NetworkEdgeSecurityServicesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -26533,6 +26838,8 @@ type NetworkEndpointGroupAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -26803,6 +27110,8 @@ type NetworkEndpointGroupListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -27072,6 +27381,8 @@ type NetworkEndpointGroupsListNetworkEndpointsWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -27213,6 +27524,8 @@ type NetworkEndpointGroupsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -27373,6 +27686,8 @@ type NetworkInterface struct { // Possible values: // "GVNIC" - GVNIC // "IDPF" - IDPF + // "IRDMA" - IRDMA + // "MRDMA" - MRDMA // "UNSPECIFIED_NIC_TYPE" - No type specified. // "VIRTIO_NET" - VIRTIO NicType string `json:"nicType,omitempty"` @@ -27504,6 +27819,8 @@ type NetworkListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -27680,11 +27997,443 @@ func (s NetworkPerformanceConfig) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// NetworkProfile: NetworkProfile represents a Google managed network profile +// resource. +type NetworkProfile struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + // Description: [Output Only] An optional description of this resource. + Description string `json:"description,omitempty"` + // Features: [Output Only] Features supported by the network. + Features *NetworkProfileNetworkFeatures `json:"features,omitempty"` + // Id: [Output Only] The unique identifier for the resource. This identifier is + // defined by the server. + Id uint64 `json:"id,omitempty,string"` + // Kind: [Output Only] Type of the resource. Always compute#networkProfile for + // network profiles. + Kind string `json:"kind,omitempty"` + // Location: [Output Only] Location to which the network is restricted. + Location *NetworkProfileLocation `json:"location,omitempty"` + // Name: [Output Only] Name of the resource. + Name string `json:"name,omitempty"` + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + // SelfLinkWithId: [Output Only] Server-defined URL for this resource with the + // resource id. + SelfLinkWithId string `json:"selfLinkWithId,omitempty"` + // Zone: [Output Only] Zone to which the network is restricted. + Zone string `json:"zone,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CreationTimestamp") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreationTimestamp") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s NetworkProfile) MarshalJSON() ([]byte, error) { + type NoMethod NetworkProfile + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type NetworkProfileLocation struct { + Name string `json:"name,omitempty"` + // Possible values: + // "REGION" + // "ZONE" + Scope string `json:"scope,omitempty"` + // ForceSendFields is a list of field names (e.g. "Name") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Name") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s NetworkProfileLocation) MarshalJSON() ([]byte, error) { + type NoMethod NetworkProfileLocation + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type NetworkProfileNetworkFeatures struct { + // AddressPurposes: Specifies what address purposes are supported. If empty, + // all address purposes are supported. + // + // Possible values: + // "DNS_RESOLVER" - DNS resolver address in the subnetwork. + // "GCE_ENDPOINT" - VM internal/alias IP, Internal LB service IP, etc. + // "IPSEC_INTERCONNECT" - A regional internal IP address range reserved for + // the VLAN attachment that is used in HA VPN over Cloud Interconnect. This + // regional internal IP address range must not overlap with any IP address + // range of subnet/route in the VPC network and its peering networks. After the + // VLAN attachment is created with the reserved IP address range, when creating + // a new VPN gateway, its interface IP address is allocated from the associated + // VLAN attachment’s IP address range. + // "NAT_AUTO" - External IP automatically reserved for Cloud NAT. + // "PRIVATE_SERVICE_CONNECT" - A private network IP address that can be used + // to configure Private Service Connect. This purpose can be specified only for + // GLOBAL addresses of Type INTERNAL + // "SERVERLESS" - A regional internal IP address range reserved for + // Serverless. + // "SHARED_LOADBALANCER_VIP" - A private network IP address that can be + // shared by multiple Internal Load Balancer forwarding rules. + // "VPC_PEERING" - IP range for peer networks. + AddressPurposes []string `json:"addressPurposes,omitempty"` + // AllowAliasIpRanges: Specifies whether alias IP ranges (and secondary address + // ranges) are allowed. + // + // Possible values: + // "ALIAS_IP_RANGES_ALLOWED" + // "ALIAS_IP_RANGES_BLOCKED" + AllowAliasIpRanges string `json:"allowAliasIpRanges,omitempty"` + // AllowAutoModeSubnet: Specifies whether auto mode subnet creation is allowed. + // + // Possible values: + // "AUTO_MODE_SUBNET_ALLOWED" + // "AUTO_MODE_SUBNET_BLOCKED" + AllowAutoModeSubnet string `json:"allowAutoModeSubnet,omitempty"` + // AllowClassDFirewalls: Specifies whether firewalls for Class D address ranges + // are supported. + // + // Possible values: + // "CLASS_D_FIREWALLS_ALLOWED" + // "CLASS_D_FIREWALLS_BLOCKED" + AllowClassDFirewalls string `json:"allowClassDFirewalls,omitempty"` + // AllowCloudNat: Specifies whether cloud NAT creation is allowed. + // + // Possible values: + // "CLOUD_NAT_ALLOWED" + // "CLOUD_NAT_BLOCKED" + AllowCloudNat string `json:"allowCloudNat,omitempty"` + // AllowCloudRouter: Specifies whether cloud router creation is allowed. + // + // Possible values: + // "CLOUD_ROUTER_ALLOWED" + // "CLOUD_ROUTER_BLOCKED" + AllowCloudRouter string `json:"allowCloudRouter,omitempty"` + // AllowExternalIpAccess: Specifies whether VMs are allowed to have external IP + // access on network interfaces connected to this VPC. + // + // Possible values: + // "EXTERNAL_IP_ACCESS_ALLOWED" + // "EXTERNAL_IP_ACCESS_BLOCKED" + AllowExternalIpAccess string `json:"allowExternalIpAccess,omitempty"` + // AllowInterconnect: Specifies whether Cloud Interconnect creation is allowed. + // + // Possible values: + // "INTERCONNECT_ALLOWED" + // "INTERCONNECT_BLOCKED" + AllowInterconnect string `json:"allowInterconnect,omitempty"` + // AllowLoadBalancing: Specifies whether cloud load balancing is allowed. + // + // Possible values: + // "LOAD_BALANCING_ALLOWED" + // "LOAD_BALANCING_BLOCKED" + AllowLoadBalancing string `json:"allowLoadBalancing,omitempty"` + // AllowMultiNicInSameNetwork: Specifies whether multi-nic in the same network + // is allowed. + // + // Possible values: + // "MULTI_NIC_IN_SAME_NETWORK_ALLOWED" + // "MULTI_NIC_IN_SAME_NETWORK_BLOCKED" + AllowMultiNicInSameNetwork string `json:"allowMultiNicInSameNetwork,omitempty"` + // AllowPacketMirroring: Specifies whether Packet Mirroring 1.0 is supported. + // + // Possible values: + // "PACKET_MIRRORING_ALLOWED" + // "PACKET_MIRRORING_BLOCKED" + AllowPacketMirroring string `json:"allowPacketMirroring,omitempty"` + // AllowPrivateGoogleAccess: Specifies whether private Google access is + // allowed. + // + // Possible values: + // "PRIVATE_GOOGLE_ACCESS_ALLOWED" + // "PRIVATE_GOOGLE_ACCESS_BLOCKED" + AllowPrivateGoogleAccess string `json:"allowPrivateGoogleAccess,omitempty"` + // AllowPsc: Specifies whether PSC creation is allowed. + // + // Possible values: + // "PSC_ALLOWED" + // "PSC_BLOCKED" + AllowPsc string `json:"allowPsc,omitempty"` + // AllowSameNetworkUnicast: Specifies whether unicast within the same network + // is allowed. + // + // Possible values: + // "SAME_NETWORK_UNICAST_ALLOWED" + // "SAME_NETWORK_UNICAST_BLOCKED" + AllowSameNetworkUnicast string `json:"allowSameNetworkUnicast,omitempty"` + // AllowStaticRoutes: Specifies whether static route creation is allowed. + // + // Possible values: + // "STATIC_ROUTES_ALLOWED" + // "STATIC_ROUTES_BLOCKED" + AllowStaticRoutes string `json:"allowStaticRoutes,omitempty"` + // AllowSubInterfaces: Specifies whether sub interfaces are allowed. + // + // Possible values: + // "SUBINTERFACES_ALLOWED" + // "SUBINTERFACES_BLOCKED" + AllowSubInterfaces string `json:"allowSubInterfaces,omitempty"` + // AllowVpcPeering: Specifies whether VPC peering is allowed. + // + // Possible values: + // "VPC_PEERING_ALLOWED" + // "VPC_PEERING_BLOCKED" + AllowVpcPeering string `json:"allowVpcPeering,omitempty"` + // AllowVpn: Specifies whether VPN creation is allowed. + // + // Possible values: + // "VPN_ALLOWED" + // "VPN_BLOCKED" + AllowVpn string `json:"allowVpn,omitempty"` + // InterfaceTypes: If set, limits the interface types that the network + // supports. If empty, all interface types are supported. + // + // Possible values: + // "GVNIC" - GVNIC + // "IDPF" - IDPF + // "IRDMA" - IRDMA + // "MRDMA" - MRDMA + // "UNSPECIFIED_NIC_TYPE" - No type specified. + // "VIRTIO_NET" - VIRTIO + InterfaceTypes []string `json:"interfaceTypes,omitempty"` + // SubnetPurposes: Specifies which subnetwork purposes are supported. + // + // Possible values: + // "SUBNET_PURPOSE_CUSTOM_HARDWARE" + // "SUBNET_PURPOSE_PRIVATE" + SubnetPurposes []string `json:"subnetPurposes,omitempty"` + // SubnetStackTypes: Specifies which subnetwork stack types are supported. + // + // Possible values: + // "SUBNET_STACK_TYPE_IPV4_IPV6" + // "SUBNET_STACK_TYPE_IPV4_ONLY" + // "SUBNET_STACK_TYPE_IPV6_ONLY" + SubnetStackTypes []string `json:"subnetStackTypes,omitempty"` + // Unicast: Specifies which type of unicast is supported. + // + // Possible values: + // "UNICAST_SDN" + // "UNICAST_ULL" + Unicast string `json:"unicast,omitempty"` + // ForceSendFields is a list of field names (e.g. "AddressPurposes") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "AddressPurposes") to include in + // API requests with the JSON null value. By default, fields with empty values + // are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s NetworkProfileNetworkFeatures) MarshalJSON() ([]byte, error) { + type NoMethod NetworkProfileNetworkFeatures + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// NetworkProfilesListResponse: Contains a list of network profiles. +type NetworkProfilesListResponse struct { + Etag string `json:"etag,omitempty"` + // Id: [Output Only] Unique identifier for the resource; defined by the server. + Id string `json:"id,omitempty"` + // Items: A list of NetworkProfile resources. + Items []*NetworkProfile `json:"items,omitempty"` + // Kind: [Output Only] Type of resource. Always compute#networkProfileList for + // network profiles. + Kind string `json:"kind,omitempty"` + // NextPageToken: [Output Only] This token allows you to get the next page of + // results for list requests. If the number of results is larger than + // maxResults, use the nextPageToken as a value for the query parameter + // pageToken in the next list request. Subsequent list requests will have their + // own nextPageToken to continue paging through the results. + NextPageToken string `json:"nextPageToken,omitempty"` + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + // Unreachables: [Output Only] Unreachable resources. end_interface: + // MixerListResponseWithEtagBuilder + Unreachables []string `json:"unreachables,omitempty"` + // Warning: [Output Only] Informational warning message. + Warning *NetworkProfilesListResponseWarning `json:"warning,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Etag") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s NetworkProfilesListResponse) MarshalJSON() ([]byte, error) { + type NoMethod NetworkProfilesListResponse + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +// NetworkProfilesListResponseWarning: [Output Only] Informational warning +// message. +type NetworkProfilesListResponseWarning struct { + // Code: [Output Only] A warning code, if applicable. For example, Compute + // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. + // + // Possible values: + // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made + // by a failed operation. + // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created. + // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources + // has a type marked as deprecated + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is + // larger than image size. + // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the + // resources has a type marked as experimental + // "EXTERNAL_API_WARNING" - Warning that is present in an external api call + // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been + // overridden. Deprecated unused field. + // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected + // kernel, which is deprecated. + // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend + // service is associated with a health check that is not of type + // HTTP/HTTPS/HTTP2. + // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a + // exceedingly large number of resources + // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list + // overhead quota exceed which captures the amount of resources filtered out by + // user-defined list filter. + // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not + // assigned to an instance on the network. + // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip + // forward. + // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance + // URL refers to an instance that does not have an ipv6 interface on the same + // network as the route. + // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to + // an instance that does not exist. + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL + // refers to an instance that is not on the same network as the route. + // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a + // status of RUNNING. + // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue + // the process despite the mentioned error. + // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. + // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing + // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). + // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that + // requires a TOS they have not accepted. + // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is + // in use. + // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete + // could not be deleted because they were in use. + // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is + // ignored. + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance + // group manager is valid as such, but its application does not make a lot of + // sense, because it allows only single instance in instance group. + // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are + // present + // "UNREACHABLE" - A given scope cannot be reached. + Code string `json:"code,omitempty"` + // Data: [Output Only] Metadata about this warning in key: value format. For + // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } + Data []*NetworkProfilesListResponseWarningData `json:"data,omitempty"` + // Message: [Output Only] A human-readable description of the warning code. + Message string `json:"message,omitempty"` + // ForceSendFields is a list of field names (e.g. "Code") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Code") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s NetworkProfilesListResponseWarning) MarshalJSON() ([]byte, error) { + type NoMethod NetworkProfilesListResponseWarning + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type NetworkProfilesListResponseWarningData struct { + // Key: [Output Only] A key that provides more detail on the warning being + // returned. For example, for warnings where there are no results in a list + // request for a particular zone, this key might be scope and the key value + // might be the zone name. Other examples might be a key indicating a + // deprecated resource and a suggested replacement, or a warning about invalid + // network settings (for example, if an instance attempts to perform IP + // forwarding but is not enabled for IP forwarding). + Key string `json:"key,omitempty"` + // Value: [Output Only] A warning data value corresponding to the key. + Value string `json:"value,omitempty"` + // ForceSendFields is a list of field names (e.g. "Key") to unconditionally + // include in API requests. By default, fields with empty or default values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Key") to include in API requests + // with the JSON null value. By default, fields with empty values are omitted + // from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s NetworkProfilesListResponseWarningData) MarshalJSON() ([]byte, error) { + type NoMethod NetworkProfilesListResponseWarningData + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // NetworkRoutingConfig: A routing configuration attached to a network // resource. The message includes the list of routers associated with the // network, and a flag indicating the type of routing behavior to enforce // network-wide. type NetworkRoutingConfig struct { + // BgpAlwaysCompareMed: Enable comparison of Multi-Exit Discriminators (MED) + // across routes with different neighbor ASNs when using the STANDARD BGP best + // path selection algorithm. + BgpAlwaysCompareMed bool `json:"bgpAlwaysCompareMed,omitempty"` + // BgpBestPathSelectionMode: The BGP best path selection algorithm to be + // employed within this network for dynamic routes learned by Cloud Routers. + // Can be LEGACY (default) or STANDARD. + // + // Possible values: + // "LEGACY" + // "STANDARD" + BgpBestPathSelectionMode string `json:"bgpBestPathSelectionMode,omitempty"` + // BgpInterRegionCost: Allows to define a preferred approach for handling + // inter-region cost in the selection process when using the STANDARD BGP best + // path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED. + // + // Possible values: + // "ADD_COST_TO_MED" + // "DEFAULT" + BgpInterRegionCost string `json:"bgpInterRegionCost,omitempty"` // RoutingMode: The network-wide routing mode to use. If set to REGIONAL, this // network's Cloud Routers will only advertise routes with subnets of this // network in the same region as the router. If set to GLOBAL, this network's @@ -27695,15 +28444,15 @@ type NetworkRoutingConfig struct { // "GLOBAL" // "REGIONAL" RoutingMode string `json:"routingMode,omitempty"` - // ForceSendFields is a list of field names (e.g. "RoutingMode") to + // ForceSendFields is a list of field names (e.g. "BgpAlwaysCompareMed") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` - // NullFields is a list of field names (e.g. "RoutingMode") to include in API - // requests with the JSON null value. By default, fields with empty values are - // omitted from API requests. See + // NullFields is a list of field names (e.g. "BgpAlwaysCompareMed") to include + // in API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` } @@ -28055,6 +28804,8 @@ type NodeGroupAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -28243,6 +28994,8 @@ type NodeGroupListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -28527,6 +29280,8 @@ type NodeGroupsListNodesWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -28690,6 +29445,8 @@ type NodeGroupsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -28973,6 +29730,8 @@ type NodeTemplateAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -29127,6 +29886,8 @@ type NodeTemplateListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -29289,6 +30050,8 @@ type NodeTemplatesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -29502,6 +30265,8 @@ type NodeTypeAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -29656,6 +30421,8 @@ type NodeTypeListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -29795,6 +30562,8 @@ type NodeTypesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -30046,6 +30815,8 @@ type NotificationEndpointListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -30356,6 +31127,8 @@ type OperationWarnings struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -30512,6 +31285,8 @@ type OperationAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -30667,6 +31442,8 @@ type OperationListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -30806,6 +31583,8 @@ type OperationsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -31173,6 +31952,8 @@ type PacketMirroringAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -31391,6 +32172,8 @@ type PacketMirroringListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -31635,6 +32418,8 @@ type PacketMirroringsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -31736,14 +32521,10 @@ type PathMatcher struct { // DefaultRouteAction: defaultRouteAction takes effect when none of the // pathRules or routeRules match. The load balancer performs advanced routing // actions, such as URL rewrites and header transformations, before forwarding - // the request to the selected backend. If defaultRouteAction specifies any - // weightedBackendServices, defaultService must not be set. Conversely if - // defaultService is set, defaultRouteAction cannot contain any - // weightedBackendServices. If defaultRouteAction is specified, don't set - // defaultUrlRedirect. If defaultRouteAction.weightedBackendServices is - // specified, don't set defaultService. URL maps for classic Application Load - // Balancers only support the urlRewrite action within a path matcher's - // defaultRouteAction. + // the request to the selected backend. Only one of defaultUrlRedirect, + // defaultService or defaultRouteAction.weightedBackendService can be set. URL + // maps for classic Application Load Balancers only support the urlRewrite + // action within a path matcher's defaultRouteAction. DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"` // DefaultService: The full or partial URL to the BackendService resource. This // URL is used if none of the pathRules or routeRules defined by this @@ -31754,20 +32535,17 @@ type PathMatcher struct { // compute/v1/projects/project/global/backendServices/backendService - // global/backendServices/backendService If defaultRouteAction is also // specified, advanced routing actions, such as URL rewrites, take effect - // before sending the request to the backend. However, if defaultService is - // specified, defaultRouteAction cannot contain any weightedBackendServices. - // Conversely, if defaultRouteAction specifies any weightedBackendServices, - // defaultService must not be specified. If defaultService is specified, then - // set either defaultUrlRedirect or defaultRouteAction.weightedBackendService. - // Don't set both. Authorization requires one or more of the following Google - // IAM permissions on the specified resource default_service: - - // compute.backendBuckets.use - compute.backendServices.use + // before sending the request to the backend. Only one of defaultUrlRedirect, + // defaultService or defaultRouteAction.weightedBackendService can be set. + // Authorization requires one or more of the following Google IAM permissions + // on the specified resource default_service: - compute.backendBuckets.use - + // compute.backendServices.use DefaultService string `json:"defaultService,omitempty"` // DefaultUrlRedirect: When none of the specified pathRules or routeRules // match, the request is redirected to a URL specified by defaultUrlRedirect. - // If defaultUrlRedirect is specified, then set either defaultService or - // defaultRouteAction. Don't set both. Not supported when the URL map is bound - // to a target gRPC proxy. + // Only one of defaultUrlRedirect, defaultService or + // defaultRouteAction.weightedBackendService can be set. Not supported when the + // URL map is bound to a target gRPC proxy. DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"` // Description: An optional description of this resource. Provide this property // when you create the resource. @@ -31846,26 +32624,21 @@ type PathRule struct { Paths []string `json:"paths,omitempty"` // RouteAction: In response to a matching path, the load balancer performs // advanced routing actions, such as URL rewrites and header transformations, - // before forwarding the request to the selected backend. If routeAction - // specifies any weightedBackendServices, service must not be set. Conversely - // if service is set, routeAction cannot contain any weightedBackendServices. - // Only one of routeAction or urlRedirect must be set. URL maps for classic - // Application Load Balancers only support the urlRewrite action within a path - // rule's routeAction. + // before forwarding the request to the selected backend. Only one of + // urlRedirect, service or routeAction.weightedBackendService can be set. URL + // maps for classic Application Load Balancers only support the urlRewrite + // action within a path rule's routeAction. RouteAction *HttpRouteAction `json:"routeAction,omitempty"` // Service: The full or partial URL of the backend service resource to which // traffic is directed if this rule is matched. If routeAction is also // specified, advanced routing actions, such as URL rewrites, take effect - // before sending the request to the backend. However, if service is specified, - // routeAction cannot contain any weightedBackendServices. Conversely, if - // routeAction specifies any weightedBackendServices, service must not be - // specified. Only one of urlRedirect, service or - // routeAction.weightedBackendService must be set. + // before sending the request to the backend. Only one of urlRedirect, service + // or routeAction.weightedBackendService can be set. Service string `json:"service,omitempty"` // UrlRedirect: When a path pattern is matched, the request is redirected to a - // URL specified by urlRedirect. If urlRedirect is specified, service or - // routeAction must not be set. Not supported when the URL map is bound to a - // target gRPC proxy. + // URL specified by urlRedirect. Only one of urlRedirect, service or + // routeAction.weightedBackendService can be set. Not supported when the URL + // map is bound to a target gRPC proxy. UrlRedirect *HttpRedirectAction `json:"urlRedirect,omitempty"` // ForceSendFields is a list of field names (e.g. "CustomErrorResponsePolicy") // to unconditionally include in API requests. By default, fields with empty or @@ -31895,8 +32668,8 @@ type PerInstanceConfig struct { // instance. Serves as a merge key during UpdatePerInstanceConfigs operations, // that is, if a per-instance configuration with the same name exists then it // will be updated, otherwise a new one will be created for the VM instance - // with the same name. An attempt to create a per-instance configconfiguration - // for a VM instance that either doesn't exist or is not part of the group will + // with the same name. An attempt to create a per-instance configuration for a + // VM instance that either doesn't exist or is not part of the group will // result in an error. Name string `json:"name,omitempty"` // PreservedState: The intended preserved state for the given instance. Does @@ -32214,7 +32987,8 @@ type Project struct { DefaultServiceAccount string `json:"defaultServiceAccount,omitempty"` // Description: An optional textual description of the resource. Description string `json:"description,omitempty"` - // EnabledFeatures: Restricted features enabled for use on this project. + // EnabledFeatures: An optional list of restricted features enabled for use on + // this project. EnabledFeatures []string `json:"enabledFeatures,omitempty"` // Id: [Output Only] The unique identifier for the resource. This identifier is // defined by the server. This is *not* the project ID, and is just a unique ID @@ -32230,8 +33004,8 @@ type Project struct { Quotas []*Quota `json:"quotas,omitempty"` // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` - // UsageExportLocation: The naming prefix for daily usage reports and the - // Google Cloud Storage bucket where they are stored. + // UsageExportLocation: An optional naming prefix for daily usage reports and + // the Google Cloud Storage bucket where they are stored. UsageExportLocation *UsageExportLocation `json:"usageExportLocation,omitempty"` // VmDnsSetting: [Output Only] Default internal DNS setting used by VMs running // in this project. @@ -32625,6 +33399,8 @@ type PublicAdvertisedPrefixListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -32929,6 +33705,8 @@ type PublicDelegatedPrefixAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -33083,6 +33861,8 @@ type PublicDelegatedPrefixListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -33279,6 +34059,8 @@ type PublicDelegatedPrefixesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -33750,6 +34532,8 @@ type RegionQuotaStatusWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -33933,6 +34717,8 @@ type RegionAutoscalerListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -34086,6 +34872,8 @@ type RegionDiskTypeListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -34332,6 +35120,8 @@ type RegionInstanceGroupListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -34512,6 +35302,8 @@ type RegionInstanceGroupManagerListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -34871,6 +35663,8 @@ type RegionInstanceGroupManagersListInstanceConfigsRespWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -34990,6 +35784,28 @@ func (s RegionInstanceGroupManagersRecreateRequest) MarshalJSON() ([]byte, error return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +type RegionInstanceGroupManagersResumeInstancesRequest struct { + // Instances: The URLs of one or more instances to resume. This can be a full + // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Instances") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s RegionInstanceGroupManagersResumeInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod RegionInstanceGroupManagersResumeInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + type RegionInstanceGroupManagersSetTargetPoolsRequest struct { // Fingerprint: Fingerprint of the target pools information, which is a hash of // the contents. This field is used for optimistic locking when you update the @@ -35039,6 +35855,78 @@ func (s RegionInstanceGroupManagersSetTemplateRequest) MarshalJSON() ([]byte, er return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +type RegionInstanceGroupManagersStartInstancesRequest struct { + // Instances: The URLs of one or more instances to start. This can be a full + // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "Instances") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s RegionInstanceGroupManagersStartInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod RegionInstanceGroupManagersStartInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type RegionInstanceGroupManagersStopInstancesRequest struct { + // ForceStop: If this flag is set to true, the Instance Group Manager will + // proceed to stop the instances, skipping initialization on them. + ForceStop bool `json:"forceStop,omitempty"` + // Instances: The URLs of one or more instances to stop. This can be a full URL + // or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "ForceStop") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ForceStop") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s RegionInstanceGroupManagersStopInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod RegionInstanceGroupManagersStopInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + +type RegionInstanceGroupManagersSuspendInstancesRequest struct { + // ForceSuspend: If this flag is set to true, the Instance Group Manager will + // proceed to suspend the instances, skipping initialization on them. + ForceSuspend bool `json:"forceSuspend,omitempty"` + // Instances: The URLs of one or more instances to suspend. This can be a full + // URL or a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + Instances []string `json:"instances,omitempty"` + // ForceSendFields is a list of field names (e.g. "ForceSuspend") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "ForceSuspend") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s RegionInstanceGroupManagersSuspendInstancesRequest) MarshalJSON() ([]byte, error) { + type NoMethod RegionInstanceGroupManagersSuspendInstancesRequest + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + type RegionInstanceGroupsListInstances struct { // Id: [Output Only] Unique identifier for the resource; defined by the server. Id string `json:"id,omitempty"` @@ -35125,6 +36013,8 @@ type RegionInstanceGroupsListInstancesWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -35338,6 +36228,8 @@ type RegionListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -35861,6 +36753,8 @@ type ReservationAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -36015,6 +36909,8 @@ type ReservationListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -36176,6 +37072,8 @@ type ReservationsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -36376,6 +37274,8 @@ type ResourcePoliciesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -36600,6 +37500,8 @@ type ResourcePolicyAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -36913,6 +37815,8 @@ type ResourcePolicyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -37217,8 +38121,9 @@ func (s ResourcePolicyWeeklyCycleDayOfWeek) MarshalJSON() ([]byte, error) { // values set on Instance attributes as compared to the value requested by the // user (intent) in their instance CRUD calls. type ResourceStatus struct { - // PhysicalHost: [Output Only] An opaque ID of the host on which the VM is - // running. + // PhysicalHost: [Output Only] The precise location of your instance within the + // zone's data center, including the block, sub-block, and host. The field is + // formatted as follows: blockId/subBlockId/hostId. PhysicalHost string `json:"physicalHost,omitempty"` Scheduling *ResourceStatusScheduling `json:"scheduling,omitempty"` UpcomingMaintenance *UpcomingMaintenance `json:"upcomingMaintenance,omitempty"` @@ -37319,6 +38224,10 @@ type Route struct { // You can specify this as a full or partial URL. For example: // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ NextHopInstance string `json:"nextHopInstance,omitempty"` + // NextHopInterRegionCost: [Output only] Internal fixed region-to-region cost + // that Google Cloud calculates based on factors such as network performance, + // distance, and available bandwidth between regions. + NextHopInterRegionCost int64 `json:"nextHopInterRegionCost,omitempty"` // NextHopIp: The network IP address of an instance that should handle matching // packets. Both IPv6 address and IPv4 addresses are supported. Must specify an // IPv4 address in dot-decimal notation (e.g. 192.0.2.99) or an IPv6 address in @@ -37326,9 +38235,20 @@ type Route struct { // addresses will be displayed using RFC 5952 compressed format (e.g. // 2001:db8::2d9:51:0:0). Should never be an IPv4-mapped IPv6 address. NextHopIp string `json:"nextHopIp,omitempty"` + // NextHopMed: [Output Only] Multi-Exit Discriminator, a BGP route metric that + // indicates the desirability of a particular route in a network. + NextHopMed int64 `json:"nextHopMed,omitempty"` // NextHopNetwork: The URL of the local network if it should handle matching // packets. NextHopNetwork string `json:"nextHopNetwork,omitempty"` + // NextHopOrigin: [Output Only] Indicates the origin of the route. Can be IGP + // (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE. + // + // Possible values: + // "EGP" + // "IGP" + // "INCOMPLETE" + NextHopOrigin string `json:"nextHopOrigin,omitempty"` // NextHopPeering: [Output Only] The network peering name that should handle // matching packets, which should conform to RFC1035. NextHopPeering string `json:"nextHopPeering,omitempty"` @@ -37440,6 +38360,8 @@ type RouteWarnings struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -37628,6 +38550,8 @@ type RouteListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -37877,6 +38801,8 @@ type RouterAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -38394,6 +39320,8 @@ type RouterListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -39098,6 +40026,8 @@ type RoutersScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -39672,6 +40602,8 @@ type SecurityPoliciesAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -39834,6 +40766,8 @@ type SecurityPoliciesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -40347,6 +41281,8 @@ type SecurityPolicyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -40919,7 +41855,9 @@ type SecurityPolicyRuleRateLimitOptions struct { // defaults to ALL. - USER_IP: The IP address of the originating client, which // is resolved based on "userIpRequestHeaders" configured with the security // policy. If there is no "userIpRequestHeaders" configuration or an IP address - // cannot be resolved from it, the key type defaults to IP. + // cannot be resolved from it, the key type defaults to IP. - + // TLS_JA4_FINGERPRINT: JA4 TLS/SSL fingerprint if the client connects using + // HTTPS, HTTP/2 or HTTP/3. If not available, the key type defaults to ALL. // // Possible values: // "ALL" @@ -40930,6 +41868,7 @@ type SecurityPolicyRuleRateLimitOptions struct { // "REGION_CODE" // "SNI" // "TLS_JA3_FINGERPRINT" + // "TLS_JA4_FINGERPRINT" // "USER_IP" // "XFF_IP" EnforceOnKey string `json:"enforceOnKey,omitempty"` @@ -41008,7 +41947,9 @@ type SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig struct { // USER_IP: The IP address of the originating client, which is resolved based // on "userIpRequestHeaders" configured with the security policy. If there is // no "userIpRequestHeaders" configuration or an IP address cannot be resolved - // from it, the key type defaults to IP. + // from it, the key type defaults to IP. - TLS_JA4_FINGERPRINT: JA4 TLS/SSL + // fingerprint if the client connects using HTTPS, HTTP/2 or HTTP/3. If not + // available, the key type defaults to ALL. // // Possible values: // "ALL" @@ -41019,6 +41960,7 @@ type SecurityPolicyRuleRateLimitOptionsEnforceOnKeyConfig struct { // "REGION_CODE" // "SNI" // "TLS_JA3_FINGERPRINT" + // "TLS_JA4_FINGERPRINT" // "USER_IP" // "XFF_IP" EnforceOnKeyType string `json:"enforceOnKeyType,omitempty"` @@ -41492,6 +42434,8 @@ type ServiceAttachmentAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -41714,6 +42658,8 @@ type ServiceAttachmentListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -41853,6 +42799,8 @@ type ServiceAttachmentsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -42447,6 +43395,8 @@ type SnapshotListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -42913,6 +43863,8 @@ type SslCertificateAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -43066,6 +44018,8 @@ type SslCertificateListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -43283,6 +44237,8 @@ type SslCertificatesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -43440,6 +44396,8 @@ type SslPoliciesAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -43593,6 +44551,8 @@ type SslPoliciesListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -43755,6 +44715,8 @@ type SslPoliciesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -43959,6 +44921,8 @@ type SslPolicyWarnings struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -44392,6 +45356,8 @@ type StoragePoolAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -44602,6 +45568,8 @@ type StoragePoolListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -44759,6 +45727,8 @@ type StoragePoolListDisksWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -45032,6 +46002,8 @@ type StoragePoolTypeAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -45186,6 +46158,8 @@ type StoragePoolTypeListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -45326,6 +46300,8 @@ type StoragePoolTypesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -45465,6 +46441,8 @@ type StoragePoolsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -45622,14 +46600,16 @@ type Subnetwork struct { // VMs in this subnet to Google services. PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"` // Purpose: The purpose of the resource. This field can be either PRIVATE, - // GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or - // PRIVATE is the default purpose for user-created subnets or subnets that are - // automatically created in auto mode networks. Subnets with purpose set to - // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks - // that are reserved for Envoy-based load balancers. A subnet with purpose set - // to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service - // Connect. If unspecified, the subnet purpose defaults to PRIVATE. The - // enableFlowLogs field isn't supported if the subnet purpose field is set to + // GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or + // PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created + // subnets or subnets that are automatically created in auto mode networks. + // Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY + // are user-created subnetworks that are reserved for Envoy-based load + // balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to + // publish services using Private Service Connect. A subnet with purpose set to + // PEER_MIGRATION is used for subnet migration from one peered VPC to another. + // If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs + // field isn't supported if the subnet purpose field is set to // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. // // Possible values: @@ -45638,6 +46618,9 @@ type Subnetwork struct { // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal HTTP(S) Load // Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY // instead. + // "PEER_MIGRATION" - Subnetwork will be used for Migration from one peered + // VPC to another. (a transient state of subnetwork while migrating resources + // from one project to another). // "PRIVATE" - Regular user created or automatically created subnet. // "PRIVATE_NAT" - Subnetwork used as source range for Private NAT Gateways. // "PRIVATE_RFC_1918" - Regular user created or automatically created subnet. @@ -45803,6 +46786,8 @@ type SubnetworkAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -45957,6 +46942,8 @@ type SubnetworkListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -46230,6 +47217,8 @@ type SubnetworksScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -46611,6 +47600,8 @@ type TargetGrpcProxyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -46750,6 +47741,8 @@ type TargetHttpProxiesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -47027,6 +48020,8 @@ type TargetHttpProxyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -47166,6 +48161,8 @@ type TargetHttpsProxiesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -47312,14 +48309,14 @@ func (s TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, erro // Engine has two Target HTTPS Proxy resources: * Global // (/compute/docs/reference/rest/v1/targetHttpsProxies) * Regional // (/compute/docs/reference/rest/v1/regionTargetHttpsProxies) A target HTTPS -// proxy is a component of GCP HTTPS load balancers. * targetHttpProxies are -// used by global external Application Load Balancers, classic Application Load -// Balancers, cross-region internal Application Load Balancers, and Traffic -// Director. * regionTargetHttpProxies are used by regional internal -// Application Load Balancers and regional external Application Load Balancers. -// Forwarding rules reference a target HTTPS proxy, and the target proxy then -// references a URL map. For more information, read Using Target Proxies and -// Forwarding rule concepts. +// proxy is a component of Google Cloud HTTPS load balancers. * +// targetHttpProxies are used by global external Application Load Balancers, +// classic Application Load Balancers, cross-region internal Application Load +// Balancers, and Traffic Director. * regionTargetHttpProxies are used by +// regional internal Application Load Balancers and regional external +// Application Load Balancers. Forwarding rules reference a target HTTPS proxy, +// and the target proxy then references a URL map. For more information, read +// Using Target Proxies and Forwarding rule concepts. type TargetHttpsProxy struct { // AuthorizationPolicy: Optional. A URL referring to a // networksecurity.AuthorizationPolicy resource that describes how the proxy @@ -47459,6 +48456,12 @@ type TargetHttpsProxy struct { // included on requests with safe HTTP methods (GET, HEAD, OPTIONS, TRACE) // without query parameters. Requests that send Early Data with non-idempotent // HTTP methods or with query parameters will be rejected with a HTTP 425. + // "UNRESTRICTED" - This enables TLS 1.3 Early Data for requests with any + // HTTP method including non-idempotent methods list POST. This mode does not + // enforce any other limitations. This may be valuable for gRPC use cases. + // However, we do not recommend this method unless you have evaluated your + // security stance and mitigated the risk of replay attacks using other + // mechanisms. TlsEarlyData string `json:"tlsEarlyData,omitempty"` // UrlMap: A fully-qualified or valid partial URL to the UrlMap resource that // defines the mapping from URL to the BackendService. For example, the @@ -47576,6 +48579,8 @@ type TargetHttpsProxyAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -47730,6 +48735,8 @@ type TargetHttpsProxyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -47958,6 +48965,8 @@ type TargetInstanceAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -48111,6 +49120,8 @@ type TargetInstanceListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -48250,6 +49261,8 @@ type TargetInstancesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -48542,6 +49555,8 @@ type TargetPoolAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -48722,6 +49737,8 @@ type TargetPoolListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -48955,6 +49972,8 @@ type TargetPoolsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -49295,6 +50314,8 @@ type TargetSslProxyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -49434,6 +50455,8 @@ type TargetTcpProxiesScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -49706,6 +50729,8 @@ type TargetTcpProxyAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -49859,6 +50884,8 @@ type TargetTcpProxyListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -50097,6 +51124,8 @@ type TargetVpnGatewayAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -50251,6 +51280,8 @@ type TargetVpnGatewayListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -50391,6 +51422,8 @@ type TargetVpnGatewaysScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -50661,31 +51694,27 @@ type UrlMap struct { // DefaultRouteAction: defaultRouteAction takes effect when none of the // hostRules match. The load balancer performs advanced routing actions, such // as URL rewrites and header transformations, before forwarding the request to - // the selected backend. If defaultRouteAction specifies any - // weightedBackendServices, defaultService must not be set. Conversely if - // defaultService is set, defaultRouteAction cannot contain any - // weightedBackendServices. Only one of defaultRouteAction or - // defaultUrlRedirect must be set. URL maps for classic Application Load - // Balancers only support the urlRewrite action within defaultRouteAction. - // defaultRouteAction has no effect when the URL map is bound to a target gRPC - // proxy that has the validateForProxyless field set to true. + // the selected backend. Only one of defaultUrlRedirect, defaultService or + // defaultRouteAction.weightedBackendService can be set. URL maps for classic + // Application Load Balancers only support the urlRewrite action within + // defaultRouteAction. defaultRouteAction has no effect when the URL map is + // bound to a target gRPC proxy that has the validateForProxyless field set to + // true. DefaultRouteAction *HttpRouteAction `json:"defaultRouteAction,omitempty"` // DefaultService: The full or partial URL of the defaultService resource to // which traffic is directed if none of the hostRules match. If // defaultRouteAction is also specified, advanced routing actions, such as URL - // rewrites, take effect before sending the request to the backend. However, if - // defaultService is specified, defaultRouteAction cannot contain any - // defaultRouteAction.weightedBackendServices. Conversely, if - // defaultRouteAction specifies any defaultRouteAction.weightedBackendServices, - // defaultService must not be specified. If defaultService is specified, then - // set either defaultUrlRedirect , or defaultRouteAction.weightedBackendService - // Don't set both. defaultService has no effect when the URL map is bound to a - // target gRPC proxy that has the validateForProxyless field set to true. + // rewrites, take effect before sending the request to the backend. Only one of + // defaultUrlRedirect, defaultService or + // defaultRouteAction.weightedBackendService can be set. defaultService has no + // effect when the URL map is bound to a target gRPC proxy that has the + // validateForProxyless field set to true. DefaultService string `json:"defaultService,omitempty"` // DefaultUrlRedirect: When none of the specified hostRules match, the request - // is redirected to a URL specified by defaultUrlRedirect. If - // defaultUrlRedirect is specified, defaultService or defaultRouteAction must - // not be set. Not supported when the URL map is bound to a target gRPC proxy. + // is redirected to a URL specified by defaultUrlRedirect. Only one of + // defaultUrlRedirect, defaultService or + // defaultRouteAction.weightedBackendService can be set. Not supported when the + // URL map is bound to a target gRPC proxy. DefaultUrlRedirect *HttpRedirectAction `json:"defaultUrlRedirect,omitempty"` // Description: An optional description of this resource. Provide this property // when you create the resource. @@ -50841,6 +51870,8 @@ type UrlMapListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -51121,6 +52152,8 @@ type UrlMapsAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -51260,6 +52293,8 @@ type UrlMapsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -51462,14 +52497,16 @@ type UsableSubnetwork struct { // Network: Network URL. Network string `json:"network,omitempty"` // Purpose: The purpose of the resource. This field can be either PRIVATE, - // GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PRIVATE_SERVICE_CONNECT, or - // PRIVATE is the default purpose for user-created subnets or subnets that are - // automatically created in auto mode networks. Subnets with purpose set to - // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks - // that are reserved for Envoy-based load balancers. A subnet with purpose set - // to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service - // Connect. If unspecified, the subnet purpose defaults to PRIVATE. The - // enableFlowLogs field isn't supported if the subnet purpose field is set to + // GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or + // PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created + // subnets or subnets that are automatically created in auto mode networks. + // Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY + // are user-created subnetworks that are reserved for Envoy-based load + // balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to + // publish services using Private Service Connect. A subnet with purpose set to + // PEER_MIGRATION is used for subnet migration from one peered VPC to another. + // If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs + // field isn't supported if the subnet purpose field is set to // GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. // // Possible values: @@ -51478,6 +52515,9 @@ type UsableSubnetwork struct { // "INTERNAL_HTTPS_LOAD_BALANCER" - Subnet reserved for Internal HTTP(S) Load // Balancing. This is a legacy purpose, please use REGIONAL_MANAGED_PROXY // instead. + // "PEER_MIGRATION" - Subnetwork will be used for Migration from one peered + // VPC to another. (a transient state of subnetwork while migrating resources + // from one project to another). // "PRIVATE" - Regular user created or automatically created subnet. // "PRIVATE_NAT" - Subnetwork used as source range for Private NAT Gateways. // "PRIVATE_RFC_1918" - Regular user created or automatically created subnet. @@ -51650,6 +52690,8 @@ type UsableSubnetworksAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -51950,6 +52992,8 @@ type VmEndpointNatMappingsListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -52192,6 +53236,8 @@ type VpnGatewayAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -52346,6 +53392,8 @@ type VpnGatewayListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -52679,6 +53727,8 @@ type VpnGatewaysScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -52991,6 +54041,8 @@ type VpnTunnelAggregatedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -53145,6 +54197,8 @@ type VpnTunnelListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -53284,6 +54338,8 @@ type VpnTunnelsScopedListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -53541,6 +54597,8 @@ type XpnHostListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is @@ -53779,6 +54837,8 @@ type ZoneListWarning struct { // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing // due to errors + // "QUOTA_INFO_UNAVAILABLE" - Quota information is not available to client + // requests (e.g: regions.list). // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that // requires a TOS they have not accepted. // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is diff --git a/vendor/google.golang.org/api/compute/v1/compute2-gen.go b/vendor/google.golang.org/api/compute/v1/compute2-gen.go index f66a5b58a344c..1cf1f4e406ff6 100644 --- a/vendor/google.golang.org/api/compute/v1/compute2-gen.go +++ b/vendor/google.golang.org/api/compute/v1/compute2-gen.go @@ -26062,6 +26062,142 @@ func (c *InstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } +type InstanceGroupManagersResumeInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersresumeinstancesrequest *InstanceGroupManagersResumeInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ResumeInstances: Flags the specified instances in the managed instance group +// to be resumed. This method increases the targetSize and decreases the +// targetSuspendedSize of the managed instance group by the number of instances +// that you resume. The resumeInstances operation is marked DONE if the +// resumeInstances request is successful. The underlying actions take +// additional time. You must separately verify the status of the RESUMING +// action with the listmanagedinstances method. In this request, you can only +// specify instances that are suspended. For example, if an instance was +// previously suspended using the suspendInstances method, it can be resumed +// using the resumeInstances method. If a health check is attached to the +// managed instance group, the specified instances will be verified as healthy +// after they are resumed. You can specify a maximum of 1000 instances with +// this method per request. +// +// - instanceGroupManager: The name of the managed instance group. +// - project: Project ID for this request. +// - zone: The name of the zone where the managed instance group is located. +func (r *InstanceGroupManagersService) ResumeInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersresumeinstancesrequest *InstanceGroupManagersResumeInstancesRequest) *InstanceGroupManagersResumeInstancesCall { + c := &InstanceGroupManagersResumeInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersresumeinstancesrequest = instancegroupmanagersresumeinstancesrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupManagersResumeInstancesCall) RequestId(requestId string) *InstanceGroupManagersResumeInstancesCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InstanceGroupManagersResumeInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResumeInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InstanceGroupManagersResumeInstancesCall) Context(ctx context.Context) *InstanceGroupManagersResumeInstancesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InstanceGroupManagersResumeInstancesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersresumeinstancesrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resumeInstances") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instanceGroupManagers.resumeInstances" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstanceGroupManagersResumeInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type InstanceGroupManagersSetInstanceTemplateCall struct { s *Service project string @@ -26318,32 +26454,39 @@ func (c *InstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOptio return ret, nil } -type InstanceGroupManagersUpdatePerInstanceConfigsCall struct { - s *Service - project string - zone string - instanceGroupManager string - instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupManagersStartInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersstartinstancesrequest *InstanceGroupManagersStartInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdatePerInstanceConfigs: Inserts or updates per-instance configurations for -// the managed instance group. perInstanceConfig.name serves as a key used to -// distinguish whether to perform insert or patch. +// StartInstances: Flags the specified instances in the managed instance group +// to be started. This method increases the targetSize and decreases the +// targetStoppedSize of the managed instance group by the number of instances +// that you start. The startInstances operation is marked DONE if the +// startInstances request is successful. The underlying actions take additional +// time. You must separately verify the status of the STARTING action with the +// listmanagedinstances method. In this request, you can only specify instances +// that are stopped. For example, if an instance was previously stopped using +// the stopInstances method, it can be started using the startInstances method. +// If a health check is attached to the managed instance group, the specified +// instances will be verified as healthy after they are started. You can +// specify a maximum of 1000 instances with this method per request. // -// - instanceGroupManager: The name of the managed instance group. It should -// conform to RFC1035. -// - project: Project ID for this request. -// - zone: The name of the zone where the managed instance group is located. It -// should conform to RFC1035. -func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall { - c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group. +// - project: Project ID for this request. +// - zone: The name of the zone where the managed instance group is located. +func (r *InstanceGroupManagersService) StartInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersstartinstancesrequest *InstanceGroupManagersStartInstancesRequest) *InstanceGroupManagersStartInstancesCall { + c := &InstanceGroupManagersStartInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instanceGroupManager = instanceGroupManager - c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq + c.instancegroupmanagersstartinstancesrequest = instancegroupmanagersstartinstancesrequest return c } @@ -26357,7 +26500,7 @@ func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall { +func (c *InstanceGroupManagersStartInstancesCall) RequestId(requestId string) *InstanceGroupManagersStartInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -26365,36 +26508,36 @@ func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall { +func (c *InstanceGroupManagersStartInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersStartInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall { +func (c *InstanceGroupManagersStartInstancesCall) Context(ctx context.Context) *InstanceGroupManagersStartInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header { +func (c *InstanceGroupManagersStartInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstartinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/startInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -26409,12 +26552,12 @@ func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call. +// Do executes the "compute.instanceGroupManagers.startInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupManagersStartInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26446,31 +26589,45 @@ func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi return ret, nil } -type InstanceGroupsAddInstancesCall struct { - s *Service - project string - zone string - instanceGroup string - instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupManagersStopInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersstopinstancesrequest *InstanceGroupManagersStopInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddInstances: Adds a list of instances to the specified instance group. All -// of the instances in the instance group must be in the same -// network/subnetwork. Read Adding instances for more information. +// StopInstances: Flags the specified instances in the managed instance group +// to be immediately stopped. You can only specify instances that are running +// in this request. This method reduces the targetSize and increases the +// targetStoppedSize of the managed instance group by the number of instances +// that you stop. The stopInstances operation is marked DONE if the +// stopInstances request is successful. The underlying actions take additional +// time. You must separately verify the status of the STOPPING action with the +// listmanagedinstances method. If the standbyPolicy.initialDelaySec field is +// set, the group delays stopping the instances until initialDelaySec have +// passed from instance.creationTimestamp (that is, when the instance was +// created). This delay gives your application time to set itself up and +// initialize on the instance. If more than initialDelaySec seconds have passed +// since instance.creationTimestamp when this method is called, there will be +// zero delay. If the group is part of a backend service that has enabled +// connection draining, it can take up to 60 seconds after the connection +// draining duration has elapsed before the VM instance is stopped. Stopped +// instances can be started using the startInstances method. You can specify a +// maximum of 1000 instances with this method per request. // -// - instanceGroup: The name of the instance group where you are adding -// instances. -// - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall { - c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group. +// - project: Project ID for this request. +// - zone: The name of the zone where the managed instance group is located. +func (r *InstanceGroupManagersService) StopInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersstopinstancesrequest *InstanceGroupManagersStopInstancesRequest) *InstanceGroupManagersStopInstancesCall { + c := &InstanceGroupManagersStopInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instanceGroup = instanceGroup - c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersstopinstancesrequest = instancegroupmanagersstopinstancesrequest return c } @@ -26484,7 +26641,7 @@ func (r *InstanceGroupsService) AddInstances(project string, zone string, instan // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall { +func (c *InstanceGroupManagersStopInstancesCall) RequestId(requestId string) *InstanceGroupManagersStopInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -26492,36 +26649,36 @@ func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGr // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall { +func (c *InstanceGroupManagersStopInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersStopInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall { +func (c *InstanceGroupManagersStopInstancesCall) Context(ctx context.Context) *InstanceGroupManagersStopInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsAddInstancesCall) Header() http.Header { +func (c *InstanceGroupManagersStopInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/stopInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -26529,19 +26686,19 @@ func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instanceGroup": c.instanceGroup, + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.addInstances" call. +// Do executes the "compute.instanceGroupManagers.stopInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupManagersStopInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26573,184 +26730,117 @@ func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type InstanceGroupsAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstanceGroupManagersSuspendInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssuspendinstancesrequest *InstanceGroupManagersSuspendInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AggregatedList: Retrieves the list of instance groups and sorts them by -// zone. To prevent failure, Google recommends that you set the -// `returnPartialSuccess` parameter to `true`. +// SuspendInstances: Flags the specified instances in the managed instance +// group to be immediately suspended. You can only specify instances that are +// running in this request. This method reduces the targetSize and increases +// the targetSuspendedSize of the managed instance group by the number of +// instances that you suspend. The suspendInstances operation is marked DONE if +// the suspendInstances request is successful. The underlying actions take +// additional time. You must separately verify the status of the SUSPENDING +// action with the listmanagedinstances method. If the +// standbyPolicy.initialDelaySec field is set, the group delays suspension of +// the instances until initialDelaySec have passed from +// instance.creationTimestamp (that is, when the instance was created). This +// delay gives your application time to set itself up and initialize on the +// instance. If more than initialDelaySec seconds have passed since +// instance.creationTimestamp when this method is called, there will be zero +// delay. If the group is part of a backend service that has enabled connection +// draining, it can take up to 60 seconds after the connection draining +// duration has elapsed before the VM instance is suspended. Suspended +// instances can be resumed using the resumeInstances method. You can specify a +// maximum of 1000 instances with this method per request. // +// - instanceGroupManager: The name of the managed instance group. // - project: Project ID for this request. -func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall { - c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone where the managed instance group is located. +func (r *InstanceGroupManagersService) SuspendInstances(project string, zone string, instanceGroupManager string, instancegroupmanagerssuspendinstancesrequest *InstanceGroupManagersSuspendInstancesRequest) *InstanceGroupManagersSuspendInstancesCall { + c := &InstanceGroupManagersSuspendInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssuspendinstancesrequest = instancegroupmanagerssuspendinstancesrequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *InstanceGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *InstanceGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *InstanceGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceGroupsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupManagersSuspendInstancesCall) RequestId(requestId string) *InstanceGroupManagersSuspendInstancesCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall { +func (c *InstanceGroupManagersSuspendInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSuspendInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall { +func (c *InstanceGroupManagersSuspendInstancesCall) Context(ctx context.Context) *InstanceGroupManagersSuspendInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsAggregatedListCall) Header() http.Header { +func (c *InstanceGroupManagersSuspendInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssuspendinstancesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/suspendInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.aggregatedList" call. +// Do executes the "compute.instanceGroupManagers.suspendInstances" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceGroupAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstanceGroupManagersSuspendInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26769,7 +26859,7 @@ func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*In if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceGroupAggregatedList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -26782,49 +26872,32 @@ func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*In return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type InstanceGroupsDeleteCall struct { - s *Service - project string - zone string - instanceGroup string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupManagersUpdatePerInstanceConfigsCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified instance group. The instances in the group are -// not deleted. Note that instance group must not belong to a backend service. -// Read Deleting an instance group for more information. +// UpdatePerInstanceConfigs: Inserts or updates per-instance configurations for +// the managed instance group. perInstanceConfig.name serves as a key used to +// distinguish whether to perform insert or patch. // -// - instanceGroup: The name of the instance group to delete. -// - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall { - c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group. It should +// conform to RFC1035. +// - project: Project ID for this request. +// - zone: The name of the zone where the managed instance group is located. It +// should conform to RFC1035. +func (r *InstanceGroupManagersService) UpdatePerInstanceConfigs(project string, zone string, instanceGroupManager string, instancegroupmanagersupdateperinstanceconfigsreq *InstanceGroupManagersUpdatePerInstanceConfigsReq) *InstanceGroupManagersUpdatePerInstanceConfigsCall { + c := &InstanceGroupManagersUpdatePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instanceGroup = instanceGroup + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersupdateperinstanceconfigsreq = instancegroupmanagersupdateperinstanceconfigsreq return c } @@ -26838,7 +26911,7 @@ func (r *InstanceGroupsService) Delete(project string, zone string, instanceGrou // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall { +func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) RequestId(requestId string) *InstanceGroupManagersUpdatePerInstanceConfigsCall { c.urlParams_.Set("requestId", requestId) return c } @@ -26846,52 +26919,56 @@ func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDe // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall { +func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersUpdatePerInstanceConfigsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall { +func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Context(ctx context.Context) *InstanceGroupManagersUpdatePerInstanceConfigsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsDeleteCall) Header() http.Header { +func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersupdateperinstanceconfigsreq) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instanceGroup": c.instanceGroup, + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.delete" call. +// Do executes the "compute.instanceGroupManagers.updatePerInstanceConfigs" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupManagersUpdatePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -26923,195 +27000,82 @@ func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type InstanceGroupsGetCall struct { - s *Service - project string - zone string - instanceGroup string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstanceGroupsAddInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified zonal instance group. Get a list of available -// zonal instance groups by making a list() request. For managed instance -// groups, use the instanceGroupManagers or regionInstanceGroupManagers methods -// instead. +// AddInstances: Adds a list of instances to the specified instance group. All +// of the instances in the instance group must be in the same +// network/subnetwork. Read Adding instances for more information. // -// - instanceGroup: The name of the instance group. -// - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall { - c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroup: The name of the instance group where you are adding +// instances. +// - project: Project ID for this request. +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) AddInstances(project string, zone string, instanceGroup string, instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest) *InstanceGroupsAddInstancesCall { + c := &InstanceGroupsAddInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instanceGroup = instanceGroup + c.instancegroupsaddinstancesrequest = instancegroupsaddinstancesrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupsAddInstancesCall) RequestId(requestId string) *InstanceGroupsAddInstancesCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *InstanceGroupsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instanceGroup": c.instanceGroup, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.instanceGroups.get" call. -// Any non-2xx status code is an error. Response headers are in either -// *InstanceGroup.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &InstanceGroup{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type InstanceGroupsInsertCall struct { - s *Service - project string - zone string - instancegroup *InstanceGroup - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates an instance group in the specified project using the -// parameters that are included in the request. -// -// - project: Project ID for this request. -// - zone: The name of the zone where you want to create the instance group. -func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall { - c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.zone = zone - c.instancegroup = instancegroup - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall { +func (c *InstanceGroupsAddInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsAddInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall { +func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsInsertCall) Header() http.Header { +func (c *InstanceGroupsAddInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -27119,18 +27083,19 @@ func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.insert" call. +// Do executes the "compute.instanceGroups.addInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupsAddInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27162,26 +27127,23 @@ func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type InstanceGroupsListCall struct { +type InstanceGroupsAggregatedListCall struct { s *Service project string - zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves the list of zonal instance group resources contained within -// the specified zone. For managed instance groups, use the -// instanceGroupManagers or regionInstanceGroupManagers methods instead. +// AggregatedList: Retrieves the list of instance groups and sorts them by +// zone. To prevent failure, Google recommends that you set the +// `returnPartialSuccess` parameter to `true`. // // - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall { - c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall { + c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone return c } @@ -27217,17 +27179,30 @@ func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroup // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *InstanceGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceGroupsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -27240,7 +27215,7 @@ func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsLis // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) OrderBy(orderBy string) *InstanceGroupsAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -27248,7 +27223,7 @@ func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -27258,15 +27233,23 @@ func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsList // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InstanceGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *InstanceGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceGroupsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27274,27 +27257,27 @@ func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsLis // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupsAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall { +func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsListCall) Header() http.Header { +func (c *InstanceGroupsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -27302,7 +27285,7 @@ func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -27311,18 +27294,17 @@ func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.list" call. +// Do executes the "compute.instanceGroups.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceGroupList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) { +// *InstanceGroupAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27341,7 +27323,7 @@ func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGrou if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceGroupList{ + ret := &InstanceGroupAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27357,7 +27339,7 @@ func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGrou // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error { +func (c *InstanceGroupsAggregatedListCall) Pages(ctx context.Context, f func(*InstanceGroupAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -27375,148 +27357,77 @@ func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGrou } } -type InstanceGroupsListInstancesCall struct { - s *Service - project string - zone string - instanceGroup string - instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupsDeleteCall struct { + s *Service + project string + zone string + instanceGroup string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListInstances: Lists the instances in the specified instance group. The -// orderBy query parameter is not supported. The filter query parameter is -// supported, but only for expressions that use `eq` (equal) or `ne` (not -// equal) operators. +// Delete: Deletes the specified instance group. The instances in the group are +// not deleted. Note that instance group must not belong to a backend service. +// Read Deleting an instance group for more information. // -// - instanceGroup: The name of the instance group from which you want to -// generate a list of included instances. -// - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall { - c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroup: The name of the instance group to delete. +// - project: Project ID for this request. +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) Delete(project string, zone string, instanceGroup string) *InstanceGroupsDeleteCall { + c := &InstanceGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instanceGroup = instanceGroup - c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *InstanceGroupsListInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsListInstancesCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupsDeleteCall) RequestId(requestId string) *InstanceGroupsDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall { +func (c *InstanceGroupsDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall { +func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsListInstancesCall) Header() http.Header { +func (c *InstanceGroupsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -27529,13 +27440,12 @@ func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.listInstances" call. +// Do executes the "compute.instanceGroups.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceGroupsListInstances.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstanceGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27554,7 +27464,7 @@ func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*Ins if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceGroupsListInstances{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27567,107 +27477,75 @@ func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*Ins return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type InstanceGroupsRemoveInstancesCall struct { - s *Service - project string - zone string - instanceGroup string - instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupsGetCall struct { + s *Service + project string + zone string + instanceGroup string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// RemoveInstances: Removes one or more instances from the specified instance -// group, but does not delete those instances. If the group is part of a -// backend service that has enabled connection draining, it can take up to 60 -// seconds after the connection draining duration before the VM instance is -// removed or deleted. +// Get: Returns the specified zonal instance group. Get a list of available +// zonal instance groups by making a list() request. For managed instance +// groups, use the instanceGroupManagers or regionInstanceGroupManagers methods +// instead. // -// - instanceGroup: The name of the instance group where the specified -// instances will be removed. -// - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall { - c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroup: The name of the instance group. +// - project: Project ID for this request. +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) Get(project string, zone string, instanceGroup string) *InstanceGroupsGetCall { + c := &InstanceGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instanceGroup = instanceGroup - c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall { - c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall { +func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstanceGroupsGetCall) IfNoneMatch(entityTag string) *InstanceGroupsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall { +func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header { +func (c *InstanceGroupsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) - if err != nil { - return nil, err +func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -27680,12 +27558,12 @@ func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.removeInstances" call. +// Do executes the "compute.instanceGroups.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *InstanceGroup.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupsGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroup, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27704,7 +27582,7 @@ func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &InstanceGroup{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27717,29 +27595,26 @@ func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type InstanceGroupsSetNamedPortsCall struct { - s *Service - project string - zone string - instanceGroup string - instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupsInsertCall struct { + s *Service + project string + zone string + instancegroup *InstanceGroup + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetNamedPorts: Sets the named ports for the specified instance group. +// Insert: Creates an instance group in the specified project using the +// parameters that are included in the request. // -// - instanceGroup: The name of the instance group where the named ports are -// updated. -// - project: Project ID for this request. -// - zone: The name of the zone where the instance group is located. -func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall { - c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - zone: The name of the zone where you want to create the instance group. +func (r *InstanceGroupsService) Insert(project string, zone string, instancegroup *InstanceGroup) *InstanceGroupsInsertCall { + c := &InstanceGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instanceGroup = instanceGroup - c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest + c.instancegroup = instancegroup return c } @@ -27753,7 +27628,7 @@ func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, insta // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall { +func (c *InstanceGroupsInsertCall) RequestId(requestId string) *InstanceGroupsInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -27761,36 +27636,36 @@ func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceG // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall { +func (c *InstanceGroupsInsertCall) Fields(s ...googleapi.Field) *InstanceGroupsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall { +func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header { +func (c *InstanceGroupsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -27798,19 +27673,18 @@ func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instanceGroup": c.instanceGroup, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceGroups.setNamedPorts" call. +// Do executes the "compute.instanceGroups.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27842,7 +27716,7 @@ func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type InstanceSettingsGetCall struct { +type InstanceGroupsListCall struct { s *Service project string zone string @@ -27852,21 +27726,101 @@ type InstanceSettingsGetCall struct { header_ http.Header } -// Get: Get Instance settings. +// List: Retrieves the list of zonal instance group resources contained within +// the specified zone. For managed instance groups, use the +// instanceGroupManagers or regionInstanceGroupManagers methods instead. // // - project: Project ID for this request. -// - zone: Name of the zone for this request. -func (r *InstanceSettingsService) Get(project string, zone string) *InstanceSettingsGetCall { - c := &InstanceSettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) List(project string, zone string) *InstanceGroupsListCall { + c := &InstanceGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *InstanceGroupsListCall) OrderBy(orderBy string) *InstanceGroupsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *InstanceGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceSettingsGetCall) Fields(s ...googleapi.Field) *InstanceSettingsGetCall { +func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -27874,27 +27828,27 @@ func (c *InstanceSettingsGetCall) Fields(s ...googleapi.Field) *InstanceSettings // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstanceSettingsGetCall) IfNoneMatch(entityTag string) *InstanceSettingsGetCall { +func (c *InstanceGroupsListCall) IfNoneMatch(entityTag string) *InstanceGroupsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceSettingsGetCall) Context(ctx context.Context) *InstanceSettingsGetCall { +func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceSettingsGetCall) Header() http.Header { +func (c *InstanceGroupsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -27902,7 +27856,7 @@ func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -27916,13 +27870,13 @@ func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceSettings.get" call. +// Do executes the "compute.instanceGroups.list" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceSettings.ServerResponse.Header or (if a response was returned at +// *InstanceGroupList.ServerResponse.Header or (if a response was returned at // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *InstanceSettingsGetCall) Do(opts ...googleapi.CallOption) (*InstanceSettings, error) { +func (c *InstanceGroupsListCall) Do(opts ...googleapi.CallOption) (*InstanceGroupList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -27941,7 +27895,7 @@ func (c *InstanceSettingsGetCall) Do(opts ...googleapi.CallOption) (*InstanceSet if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceSettings{ + ret := &InstanceGroupList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -27954,211 +27908,100 @@ func (c *InstanceSettingsGetCall) Do(opts ...googleapi.CallOption) (*InstanceSet return ret, nil } -type InstanceSettingsPatchCall struct { - s *Service - project string - zone string - instancesettings *InstanceSettings - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *InstanceGroupsListCall) Pages(ctx context.Context, f func(*InstanceGroupList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Patch: Patch Instance settings +type InstanceGroupsListInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ListInstances: Lists the instances in the specified instance group. The +// orderBy query parameter is not supported. The filter query parameter is +// supported, but only for expressions that use `eq` (equal) or `ne` (not +// equal) operators. // -// - project: Project ID for this request. -// - zone: The zone scoping this request. It should conform to RFC1035. -func (r *InstanceSettingsService) Patch(project string, zone string, instancesettings *InstanceSettings) *InstanceSettingsPatchCall { - c := &InstanceSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroup: The name of the instance group from which you want to +// generate a list of included instances. +// - project: Project ID for this request. +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) ListInstances(project string, zone string, instanceGroup string, instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest) *InstanceGroupsListInstancesCall { + c := &InstanceGroupsListInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instancesettings = instancesettings + c.instanceGroup = instanceGroup + c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceSettingsPatchCall) RequestId(requestId string) *InstanceSettingsPatchCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall { + c.urlParams_.Set("filter", filter) return c } -// UpdateMask sets the optional parameter "updateMask": update_mask indicates -// fields to be updated as part of this request. -func (c *InstanceSettingsPatchCall) UpdateMask(updateMask string) *InstanceSettingsPatchCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *InstanceSettingsPatchCall) Fields(s ...googleapi.Field) *InstanceSettingsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *InstanceSettingsPatchCall) Context(ctx context.Context) *InstanceSettingsPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *InstanceSettingsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *InstanceSettingsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesettings) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.instanceSettings.patch" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceSettingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type InstanceTemplatesAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// AggregatedList: Retrieves the list of all InstanceTemplates resources, -// regional and global, available to the specified project. To prevent failure, -// Google recommends that you set the `returnPartialSuccess` parameter to -// `true`. -// -// - project: Name of the project scoping this request. -func (r *InstanceTemplatesService) AggregatedList(project string) *InstanceTemplatesAggregatedListCall { - c := &InstanceTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InstanceTemplatesAggregatedListCall) Filter(filter string) *InstanceTemplatesAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *InstanceTemplatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceTemplatesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstanceTemplatesAggregatedListCall) MaxResults(maxResults int64) *InstanceTemplatesAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -28170,7 +28013,7 @@ func (c *InstanceTemplatesAggregatedListCall) MaxResults(maxResults int64) *Inst // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstanceTemplatesAggregatedListCall) OrderBy(orderBy string) *InstanceTemplatesAggregatedListCall { +func (c *InstanceGroupsListInstancesCall) OrderBy(orderBy string) *InstanceGroupsListInstancesCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -28178,7 +28021,7 @@ func (c *InstanceTemplatesAggregatedListCall) OrderBy(orderBy string) *InstanceT // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InstanceTemplatesAggregatedListCall) PageToken(pageToken string) *InstanceTemplatesAggregatedListCall { +func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -28188,78 +28031,65 @@ func (c *InstanceTemplatesAggregatedListCall) PageToken(pageToken string) *Insta // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InstanceTemplatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceTemplatesAggregatedListCall { +func (c *InstanceGroupsListInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceGroupsListInstancesCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *InstanceTemplatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceTemplatesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *InstanceTemplatesAggregatedListCall { +func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstanceTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *InstanceTemplatesAggregatedListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesAggregatedListCall) Context(ctx context.Context) *InstanceTemplatesAggregatedListCall { +func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesAggregatedListCall) Header() http.Header { +func (c *InstanceGroupsListInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.aggregatedList" call. +// Do executes the "compute.instanceGroups.listInstances" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceTemplateAggregatedList.ServerResponse.Header or (if a response was +// *InstanceGroupsListInstances.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InstanceTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateAggregatedList, error) { +func (c *InstanceGroupsListInstancesCall) Do(opts ...googleapi.CallOption) (*InstanceGroupsListInstances, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28278,7 +28108,7 @@ func (c *InstanceTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceTemplateAggregatedList{ + ret := &InstanceGroupsListInstances{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28294,7 +28124,7 @@ func (c *InstanceTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) ( // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InstanceTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceTemplateAggregatedList) error) error { +func (c *InstanceGroupsListInstancesCall) Pages(ctx context.Context, f func(*InstanceGroupsListInstances) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -28312,25 +28142,33 @@ func (c *InstanceTemplatesAggregatedListCall) Pages(ctx context.Context, f func( } } -type InstanceTemplatesDeleteCall struct { - s *Service - project string - instanceTemplate string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceGroupsRemoveInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified instance template. Deleting an instance -// template is permanent and cannot be undone. It is not possible to delete -// templates that are already in use by a managed instance group. +// RemoveInstances: Removes one or more instances from the specified instance +// group, but does not delete those instances. If the group is part of a +// backend service that has enabled connection draining, it can take up to 60 +// seconds after the connection draining duration before the VM instance is +// removed or deleted. // -// - instanceTemplate: The name of the instance template to delete. -// - project: Project ID for this request. -func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall { - c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroup: The name of the instance group where the specified +// instances will be removed. +// - project: Project ID for this request. +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) RemoveInstances(project string, zone string, instanceGroup string, instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest) *InstanceGroupsRemoveInstancesCall { + c := &InstanceGroupsRemoveInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.instanceTemplate = instanceTemplate + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest return c } @@ -28344,7 +28182,7 @@ func (r *InstanceTemplatesService) Delete(project string, instanceTemplate strin // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall { +func (c *InstanceGroupsRemoveInstancesCall) RequestId(requestId string) *InstanceGroupsRemoveInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -28352,51 +28190,56 @@ func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTempl // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall { +func (c *InstanceGroupsRemoveInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsRemoveInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall { +func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesDeleteCall) Header() http.Header { +func (c *InstanceGroupsRemoveInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "instanceTemplate": c.instanceTemplate, + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.delete" call. +// Do executes the "compute.instanceGroups.removeInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceGroupsRemoveInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28428,87 +28271,100 @@ func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type InstanceTemplatesGetCall struct { - s *Service - project string - instanceTemplate string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstanceGroupsSetNamedPortsCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified instance template. +// SetNamedPorts: Sets the named ports for the specified instance group. // -// - instanceTemplate: The name of the instance template. -// - project: Project ID for this request. -func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall { - c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroup: The name of the instance group where the named ports are +// updated. +// - project: Project ID for this request. +// - zone: The name of the zone where the instance group is located. +func (r *InstanceGroupsService) SetNamedPorts(project string, zone string, instanceGroup string, instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest) *InstanceGroupsSetNamedPortsCall { + c := &InstanceGroupsSetNamedPortsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.instanceTemplate = instanceTemplate + c.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceGroupsSetNamedPortsCall) RequestId(requestId string) *InstanceGroupsSetNamedPortsCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall { +func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall { +func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesGetCall) Header() http.Header { +func (c *InstanceGroupsSetNamedPortsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "instanceTemplate": c.instanceTemplate, + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.get" call. +// Do executes the "compute.instanceGroups.setNamedPorts" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceTemplate.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstanceGroupsSetNamedPortsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28527,7 +28383,7 @@ func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceTemplate{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28540,39 +28396,31 @@ func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTe return ret, nil } -type InstanceTemplatesGetIamPolicyCall struct { +type InstanceSettingsGetCall struct { s *Service project string - resource string + zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// Get: Get Instance settings. // // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall { - c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: Name of the zone for this request. +func (r *InstanceSettingsService) Get(project string, zone string) *InstanceSettingsGetCall { + c := &InstanceSettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *InstanceTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstanceTemplatesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) + c.zone = zone return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall { +func (c *InstanceSettingsGetCall) Fields(s ...googleapi.Field) *InstanceSettingsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28580,27 +28428,27 @@ func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *Instan // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall { +func (c *InstanceSettingsGetCall) IfNoneMatch(entityTag string) *InstanceSettingsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall { +func (c *InstanceSettingsGetCall) Context(ctx context.Context) *InstanceSettingsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header { +func (c *InstanceSettingsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceSettingsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -28608,7 +28456,7 @@ func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Respons var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -28616,18 +28464,19 @@ func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Respons } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.getIamPolicy" call. +// Do executes the "compute.instanceSettings.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *InstanceSettings.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceSettingsGetCall) Do(opts ...googleapi.CallOption) (*InstanceSettings, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28646,7 +28495,7 @@ func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*P if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &InstanceSettings{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28659,26 +28508,25 @@ func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*P return ret, nil } -type InstanceTemplatesInsertCall struct { +type InstanceSettingsPatchCall struct { s *Service project string - instancetemplate *InstanceTemplate + zone string + instancesettings *InstanceSettings urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Insert: Creates an instance template in the specified project using the data -// that is included in the request. If you are creating a new template to -// update an existing instance group, your new instance template must use the -// same network or, if applicable, the same subnetwork as the original -// template. +// Patch: Patch Instance settings // // - project: Project ID for this request. -func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall { - c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The zone scoping this request. It should conform to RFC1035. +func (r *InstanceSettingsService) Patch(project string, zone string, instancesettings *InstanceSettings) *InstanceSettingsPatchCall { + c := &InstanceSettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.instancetemplate = instancetemplate + c.zone = zone + c.instancesettings = instancesettings return c } @@ -28692,62 +28540,70 @@ func (r *InstanceTemplatesService) Insert(project string, instancetemplate *Inst // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall { +func (c *InstanceSettingsPatchCall) RequestId(requestId string) *InstanceSettingsPatchCall { c.urlParams_.Set("requestId", requestId) return c } +// UpdateMask sets the optional parameter "updateMask": update_mask indicates +// fields to be updated as part of this request. +func (c *InstanceSettingsPatchCall) UpdateMask(updateMask string) *InstanceSettingsPatchCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall { +func (c *InstanceSettingsPatchCall) Fields(s ...googleapi.Field) *InstanceSettingsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall { +func (c *InstanceSettingsPatchCall) Context(ctx context.Context) *InstanceSettingsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesInsertCall) Header() http.Header { +func (c *InstanceSettingsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceSettingsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesettings) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instanceSettings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.insert" call. +// Do executes the "compute.instanceSettings.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceSettingsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28779,7 +28635,7 @@ func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type InstanceTemplatesListCall struct { +type InstanceTemplatesAggregatedListCall struct { s *Service project string urlParams_ gensupport.URLParams @@ -28788,12 +28644,14 @@ type InstanceTemplatesListCall struct { header_ http.Header } -// List: Retrieves a list of instance templates that are contained within the -// specified project. +// AggregatedList: Retrieves the list of all InstanceTemplates resources, +// regional and global, available to the specified project. To prevent failure, +// Google recommends that you set the `returnPartialSuccess` parameter to +// `true`. // -// - project: Project ID for this request. -func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall { - c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Name of the project scoping this request. +func (r *InstanceTemplatesService) AggregatedList(project string) *InstanceTemplatesAggregatedListCall { + c := &InstanceTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } @@ -28830,17 +28688,30 @@ func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCa // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) Filter(filter string) *InstanceTemplatesAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *InstanceTemplatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstanceTemplatesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) MaxResults(maxResults int64) *InstanceTemplatesAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -28853,7 +28724,7 @@ func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTempla // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) OrderBy(orderBy string) *InstanceTemplatesAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -28861,7 +28732,7 @@ func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesLi // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) PageToken(pageToken string) *InstanceTemplatesAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -28871,15 +28742,23 @@ func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplat // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InstanceTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceTemplatesAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *InstanceTemplatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstanceTemplatesAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *InstanceTemplatesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -28887,27 +28766,27 @@ func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTempla // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *InstanceTemplatesAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall { +func (c *InstanceTemplatesAggregatedListCall) Context(ctx context.Context) *InstanceTemplatesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesListCall) Header() http.Header { +func (c *InstanceTemplatesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -28915,7 +28794,7 @@ func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instanceTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -28928,13 +28807,13 @@ func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.list" call. +// Do executes the "compute.instanceTemplates.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceTemplateList.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) { +// *InstanceTemplateAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -28953,7 +28832,7 @@ func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceT if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceTemplateList{ + ret := &InstanceTemplateAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -28969,7 +28848,7 @@ func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceT // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error { +func (c *InstanceTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceTemplateAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -28987,81 +28866,91 @@ func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceT } } -type InstanceTemplatesSetIamPolicyCall struct { - s *Service - project string - resource string - globalsetpolicyrequest *GlobalSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceTemplatesDeleteCall struct { + s *Service + project string + instanceTemplate string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// Delete: Deletes the specified instance template. Deleting an instance +// template is permanent and cannot be undone. It is not possible to delete +// templates that are already in use by a managed instance group. // +// - instanceTemplate: The name of the instance template to delete. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall { - c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall { + c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.globalsetpolicyrequest = globalsetpolicyrequest + c.instanceTemplate = instanceTemplate + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstanceTemplatesDeleteCall) RequestId(requestId string) *InstanceTemplatesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall { +func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall { +func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header { +func (c *InstanceTemplatesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "instanceTemplate": c.instanceTemplate, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.setIamPolicy" call. +// Do executes the "compute.instanceTemplates.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *InstanceTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29080,7 +28969,7 @@ func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*P if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29093,82 +28982,87 @@ func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*P return ret, nil } -type InstanceTemplatesTestIamPermissionsCall struct { - s *Service - project string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceTemplatesGetCall struct { + s *Service + project string + instanceTemplate string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// Get: Returns the specified instance template. // +// - instanceTemplate: The name of the instance template. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall { - c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall { + c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.instanceTemplate = instanceTemplate return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall { +func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstanceTemplatesGetCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall { +func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header { +func (c *InstanceTemplatesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err +func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{instanceTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "instanceTemplate": c.instanceTemplate, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instanceTemplates.testIamPermissions" call. +// Do executes the "compute.instanceTemplates.get" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *InstanceTemplate.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceTemplatesGetCall) Do(opts ...googleapi.CallOption) (*InstanceTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29187,7 +29081,7 @@ func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &InstanceTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29200,102 +29094,94 @@ func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOptio return ret, nil } -type InstancesAddAccessConfigCall struct { +type InstanceTemplatesGetIamPolicyCall struct { s *Service project string - zone string - instance string - accessconfig *AccessConfig + resource string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AddAccessConfig: Adds an access config to an instance's network interface. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // -// - instance: The instance name for this request. -// - networkInterface: The name of the network interface to add to this -// instance. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { - c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - resource: Name or id of the resource for this request. +func (r *InstanceTemplatesService) GetIamPolicy(project string, resource string) *InstanceTemplatesGetIamPolicyCall { + c := &InstanceTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.instance = instance - c.urlParams_.Set("networkInterface", networkInterface) - c.accessconfig = accessconfig + c.resource = resource return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall { - c.urlParams_.Set("requestId", requestId) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *InstanceTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstanceTemplatesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall { +func (c *InstanceTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstanceTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstanceTemplatesGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall { +func (c *InstanceTemplatesGetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesAddAccessConfigCall) Header() http.Header { +func (c *InstanceTemplatesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) - if err != nil { - return nil, err +func (c *InstanceTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, - "instance": c.instance, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.addAccessConfig" call. +// Do executes the "compute.instanceTemplates.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29314,7 +29200,7 @@ func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29327,30 +29213,26 @@ func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operat return ret, nil } -type InstancesAddResourcePoliciesCall struct { - s *Service - project string - zone string - instance string - instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceTemplatesInsertCall struct { + s *Service + project string + instancetemplate *InstanceTemplate + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddResourcePolicies: Adds existing resource policies to an instance. You can -// only add one policy right now which will be applied to this instance for -// scheduling live migrations. +// Insert: Creates an instance template in the specified project using the data +// that is included in the request. If you are creating a new template to +// update an existing instance group, your new instance template must use the +// same network or, if applicable, the same subnetwork as the original +// template. // -// - instance: The instance name for this request. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall { - c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall { + c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.instance = instance - c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest + c.instancetemplate = instancetemplate return c } @@ -29364,7 +29246,7 @@ func (r *InstancesService) AddResourcePolicies(project string, zone string, inst // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall { +func (c *InstanceTemplatesInsertCall) RequestId(requestId string) *InstanceTemplatesInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -29372,36 +29254,36 @@ func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *Instance // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall { +func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall { +func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesAddResourcePoliciesCall) Header() http.Header { +func (c *InstanceTemplatesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -29409,19 +29291,17 @@ func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.addResourcePolicies" call. +// Do executes the "compute.instanceTemplates.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29453,7 +29333,7 @@ func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type InstancesAggregatedListCall struct { +type InstanceTemplatesListCall struct { s *Service project string urlParams_ gensupport.URLParams @@ -29462,15 +29342,12 @@ type InstancesAggregatedListCall struct { header_ http.Header } -// AggregatedList: Retrieves an aggregated list of all of the instances in your -// project across all regions and zones. The performance of this method -// degrades when a filter is specified on a project that has a very large -// number of instances. To prevent failure, Google recommends that you set the -// `returnPartialSuccess` parameter to `true`. +// List: Retrieves a list of instance templates that are contained within the +// specified project. // // - project: Project ID for this request. -func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall { - c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall { + c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } @@ -29507,30 +29384,17 @@ func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedLi // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall { c.urlParams_.Set("filter", filter) return c } -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *InstancesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstancesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -29543,7 +29407,7 @@ func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAgg // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) OrderBy(orderBy string) *InstanceTemplatesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -29551,7 +29415,7 @@ func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregat // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -29561,23 +29425,15 @@ func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggr // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InstancesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstanceTemplatesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *InstancesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstancesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -29585,27 +29441,27 @@ func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAgg // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) IfNoneMatch(entityTag string) *InstanceTemplatesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall { +func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesAggregatedListCall) Header() http.Header { +func (c *InstanceTemplatesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -29613,7 +29469,7 @@ func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -29626,13 +29482,13 @@ func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.aggregatedList" call. +// Do executes the "compute.instanceTemplates.list" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceAggregatedList.ServerResponse.Header or (if a response was returned +// *InstanceTemplateList.ServerResponse.Header or (if a response was returned // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) { +func (c *InstanceTemplatesListCall) Do(opts ...googleapi.CallOption) (*InstanceTemplateList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29651,7 +29507,7 @@ func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Instanc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceAggregatedList{ + ret := &InstanceTemplateList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29667,7 +29523,7 @@ func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Instanc // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error { +func (c *InstanceTemplatesListCall) Pages(ctx context.Context, f func(*InstanceTemplateList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -29685,91 +29541,62 @@ func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*Instanc } } -type InstancesAttachDiskCall struct { - s *Service - project string - zone string - instance string - attacheddisk *AttachedDisk - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceTemplatesSetIamPolicyCall struct { + s *Service + project string + resource string + globalsetpolicyrequest *GlobalSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AttachDisk: Attaches an existing Disk resource to an instance. You must -// first create the disk before you can attach it. It is not possible to create -// and attach a disk at the same time. For more information, read Adding a -// persistent disk to your instance. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - instance: The instance name for this request. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { - c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *InstanceTemplatesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *InstanceTemplatesSetIamPolicyCall { + c := &InstanceTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.instance = instance - c.attacheddisk = attacheddisk - return c -} - -// ForceAttach sets the optional parameter "forceAttach": Whether to force -// attach the regional disk even if it's currently attached to another -// instance. If you try to force attach a zonal disk to an instance, you will -// receive an error. -func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall { - c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach)) - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.globalsetpolicyrequest = globalsetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall { +func (c *InstanceTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstanceTemplatesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall { +func (c *InstanceTemplatesSetIamPolicyCall) Context(ctx context.Context) *InstanceTemplatesSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesAttachDiskCall) Header() http.Header { +func (c *InstanceTemplatesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/attachDisk") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -29778,18 +29605,17 @@ func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, - "instance": c.instance, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.attachDisk" call. +// Do executes the "compute.instanceTemplates.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstanceTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29808,7 +29634,7 @@ func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29821,77 +29647,62 @@ func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type InstancesBulkInsertCall struct { - s *Service - project string - zone string - bulkinsertinstanceresource *BulkInsertInstanceResource - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstanceTemplatesTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BulkInsert: Creates multiple instances. Count specifies the number of -// instances to create. For more information, see About bulk creation of VMs. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) BulkInsert(project string, zone string, bulkinsertinstanceresource *BulkInsertInstanceResource) *InstancesBulkInsertCall { - c := &InstancesBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *InstanceTemplatesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstanceTemplatesTestIamPermissionsCall { + c := &InstanceTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.bulkinsertinstanceresource = bulkinsertinstanceresource - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesBulkInsertCall) RequestId(requestId string) *InstancesBulkInsertCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesBulkInsertCall) Fields(s ...googleapi.Field) *InstancesBulkInsertCall { +func (c *InstanceTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstanceTemplatesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesBulkInsertCall) Context(ctx context.Context) *InstancesBulkInsertCall { +func (c *InstanceTemplatesTestIamPermissionsCall) Context(ctx context.Context) *InstanceTemplatesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesBulkInsertCall) Header() http.Header { +func (c *InstanceTemplatesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *InstanceTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/bulkInsert") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/instanceTemplates/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -29899,18 +29710,19 @@ func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.bulkInsert" call. +// Do executes the "compute.instanceTemplates.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstanceTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -29929,7 +29741,7 @@ func (c *InstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -29942,27 +29754,31 @@ func (c *InstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type InstancesDeleteCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesAddAccessConfigCall struct { + s *Service + project string + zone string + instance string + accessconfig *AccessConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified Instance resource. For more information, see -// Deleting an instance. +// AddAccessConfig: Adds an access config to an instance's network interface. // -// - instance: Name of the instance resource to delete. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { - c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: The instance name for this request. +// - networkInterface: The name of the network interface to add to this +// instance. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { + c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance + c.urlParams_.Set("networkInterface", networkInterface) + c.accessconfig = accessconfig return c } @@ -29976,7 +29792,7 @@ func (r *InstancesService) Delete(project string, zone string, instance string) // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall { +func (c *InstancesAddAccessConfigCall) RequestId(requestId string) *InstancesAddAccessConfigCall { c.urlParams_.Set("requestId", requestId) return c } @@ -29984,34 +29800,38 @@ func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { +func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { +func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesDeleteCall) Header() http.Header { +func (c *InstancesAddAccessConfigCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -30024,12 +29844,12 @@ func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.delete" call. +// Do executes the "compute.instances.addAccessConfig" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesAddAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30061,31 +29881,30 @@ func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, erro return ret, nil } -type InstancesDeleteAccessConfigCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesAddResourcePoliciesCall struct { + s *Service + project string + zone string + instance string + instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// DeleteAccessConfig: Deletes an access config from an instance's network -// interface. +// AddResourcePolicies: Adds existing resource policies to an instance. You can +// only add one policy right now which will be applied to this instance for +// scheduling live migrations. // -// - accessConfig: The name of the access config to delete. // - instance: The instance name for this request. -// - networkInterface: The name of the network interface. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall { - c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) AddResourcePolicies(project string, zone string, instance string, instancesaddresourcepoliciesrequest *InstancesAddResourcePoliciesRequest) *InstancesAddResourcePoliciesCall { + c := &InstancesAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.urlParams_.Set("accessConfig", accessConfig) - c.urlParams_.Set("networkInterface", networkInterface) + c.instancesaddresourcepoliciesrequest = instancesaddresourcepoliciesrequest return c } @@ -30099,7 +29918,7 @@ func (r *InstancesService) DeleteAccessConfig(project string, zone string, insta // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall { +func (c *InstancesAddResourcePoliciesCall) RequestId(requestId string) *InstancesAddResourcePoliciesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -30107,32 +29926,36 @@ func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *Instances // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall { +func (c *InstancesAddResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesAddResourcePoliciesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall { +func (c *InstancesAddResourcePoliciesCall) Context(ctx context.Context) *InstancesAddResourcePoliciesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesDeleteAccessConfigCall) Header() http.Header { +func (c *InstancesAddResourcePoliciesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesaddresourcepoliciesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/addResourcePolicies") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -30147,12 +29970,12 @@ func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.deleteAccessConfig" call. +// Do executes the "compute.instances.addResourcePolicies" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30184,155 +30007,131 @@ func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type InstancesDetachDiskCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// DetachDisk: Detaches a disk from an instance. +// AggregatedList: Retrieves an aggregated list of all of the instances in your +// project across all regions and zones. The performance of this method +// degrades when a filter is specified on a project that has a very large +// number of instances. To prevent failure, Google recommends that you set the +// `returnPartialSuccess` parameter to `true`. // -// - deviceName: The device name of the disk to detach. Make a get() request on -// the instance to view currently attached disks and device names. -// - instance: Instance name for this request. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { - c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall { + c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.instance = instance - c.urlParams_.Set("deviceName", deviceName) return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall { + c.urlParams_.Set("filter", filter) return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *InstancesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstancesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) return c } -// Context sets the context to be used in this call's Do method. -func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall { - c.ctx_ = ctx +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *InstancesDetachDiskCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/detachDisk") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *InstancesAggregatedListCall) OrderBy(orderBy string) *InstancesAggregatedListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -// Do executes the "compute.instances.detachDisk" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c } -type InstancesGetCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *InstancesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesAggregatedListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c } -// Get: Returns the specified Instance resource. -// -// - instance: Name of the instance resource to return. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { - c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.zone = zone - c.instance = instance +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *InstancesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstancesAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { +func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -30340,27 +30139,27 @@ func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { +func (c *InstancesAggregatedListCall) IfNoneMatch(entityTag string) *InstancesAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { +func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetCall) Header() http.Header { +func (c *InstancesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -30368,7 +30167,7 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -30376,19 +30175,18 @@ func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.get" call. +// Do executes the "compute.instances.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *Instance.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { +// *InstanceAggregatedList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstancesAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstanceAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30407,7 +30205,7 @@ func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Instance{ + ret := &InstanceAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30420,76 +30218,114 @@ func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { return ret, nil } -type InstancesGetEffectiveFirewallsCall struct { +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *InstancesAggregatedListCall) Pages(ctx context.Context, f func(*InstanceAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type InstancesAttachDiskCall struct { s *Service project string zone string instance string + attacheddisk *AttachedDisk urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetEffectiveFirewalls: Returns effective firewalls applied to an interface -// of the instance. +// AttachDisk: Attaches an existing Disk resource to an instance. You must +// first create the disk before you can attach it. It is not possible to create +// and attach a disk at the same time. For more information, read Adding a +// persistent disk to your instance. // -// - instance: Name of the instance scoping this request. -// - networkInterface: The name of the network interface to get the effective -// firewalls. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) GetEffectiveFirewalls(project string, zone string, instance string, networkInterface string) *InstancesGetEffectiveFirewallsCall { - c := &InstancesGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: The instance name for this request. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { + c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.urlParams_.Set("networkInterface", networkInterface) + c.attacheddisk = attacheddisk + return c +} + +// ForceAttach sets the optional parameter "forceAttach": Whether to force +// attach the regional disk even if it's currently attached to another +// instance. If you try to force attach a zonal disk to an instance, you will +// receive an error. +func (c *InstancesAttachDiskCall) ForceAttach(forceAttach bool) *InstancesAttachDiskCall { + c.urlParams_.Set("forceAttach", fmt.Sprint(forceAttach)) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesAttachDiskCall) RequestId(requestId string) *InstancesAttachDiskCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *InstancesGetEffectiveFirewallsCall { +func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstancesGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *InstancesGetEffectiveFirewallsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstancesGetEffectiveFirewallsCall) Context(ctx context.Context) *InstancesGetEffectiveFirewallsCall { +func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetEffectiveFirewallsCall) Header() http.Header { +func (c *InstancesAttachDiskCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/attachDisk") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -30502,13 +30338,12 @@ func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.getEffectiveFirewalls" call. +// Do executes the "compute.instances.attachDisk" call. // Any non-2xx status code is an error. Response headers are in either -// *InstancesGetEffectiveFirewallsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstancesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*InstancesGetEffectiveFirewallsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesAttachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30527,7 +30362,7 @@ func (c *InstancesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstancesGetEffectiveFirewallsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30540,105 +30375,96 @@ func (c *InstancesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type InstancesGetGuestAttributesCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstancesBulkInsertCall struct { + s *Service + project string + zone string + bulkinsertinstanceresource *BulkInsertInstanceResource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetGuestAttributes: Returns the specified guest attributes entry. +// BulkInsert: Creates multiple instances. Count specifies the number of +// instances to create. For more information, see About bulk creation of VMs. // -// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall { - c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) BulkInsert(project string, zone string, bulkinsertinstanceresource *BulkInsertInstanceResource) *InstancesBulkInsertCall { + c := &InstancesBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instance = instance - return c -} - -// QueryPath sets the optional parameter "queryPath": Specifies the guest -// attributes path to be queried. -func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall { - c.urlParams_.Set("queryPath", queryPath) + c.bulkinsertinstanceresource = bulkinsertinstanceresource return c } -// VariableKey sets the optional parameter "variableKey": Specifies the key for -// the guest attributes entry. -func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall { - c.urlParams_.Set("variableKey", variableKey) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesBulkInsertCall) RequestId(requestId string) *InstancesBulkInsertCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall { +func (c *InstancesBulkInsertCall) Fields(s ...googleapi.Field) *InstancesBulkInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall { +func (c *InstancesBulkInsertCall) Context(ctx context.Context) *InstancesBulkInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetGuestAttributesCall) Header() http.Header { +func (c *InstancesBulkInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstancesBulkInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertinstanceresource) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/bulkInsert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.getGuestAttributes" call. +// Do executes the "compute.instances.bulkInsert" call. // Any non-2xx status code is an error. Response headers are in either -// *GuestAttributes.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30657,7 +30483,7 @@ func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*Gue if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &GuestAttributes{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30670,80 +30496,76 @@ func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*Gue return ret, nil } -type InstancesGetIamPolicyCall struct { - s *Service - project string - zone string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstancesDeleteCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// Delete: Deletes the specified Instance resource. For more information, see +// Deleting an instance. // +// - instance: Name of the instance resource to delete. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall { - c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { + c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource + c.instance = instance return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *InstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstancesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesDeleteCall) RequestId(requestId string) *InstancesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall { +func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall { +func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetIamPolicyCall) Header() http.Header { +func (c *InstancesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -30751,17 +30573,17 @@ func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "resource": c.resource, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.getIamPolicy" call. +// Do executes the "compute.instances.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *InstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30780,7 +30602,7 @@ func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30793,72 +30615,80 @@ func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, e return ret, nil } -type InstancesGetScreenshotCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstancesDeleteAccessConfigCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetScreenshot: Returns the screenshot from the specified instance. +// DeleteAccessConfig: Deletes an access config from an instance's network +// interface. // -// - instance: Name of the instance scoping this request. +// - accessConfig: The name of the access config to delete. +// - instance: The instance name for this request. +// - networkInterface: The name of the network interface. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) GetScreenshot(project string, zone string, instance string) *InstancesGetScreenshotCall { - c := &InstancesGetScreenshotCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall { + c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance + c.urlParams_.Set("accessConfig", accessConfig) + c.urlParams_.Set("networkInterface", networkInterface) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesDeleteAccessConfigCall) RequestId(requestId string) *InstancesDeleteAccessConfigCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetScreenshotCall) Fields(s ...googleapi.Field) *InstancesGetScreenshotCall { +func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstancesGetScreenshotCall) IfNoneMatch(entityTag string) *InstancesGetScreenshotCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstancesGetScreenshotCall) Context(ctx context.Context) *InstancesGetScreenshotCall { +func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetScreenshotCall) Header() http.Header { +func (c *InstancesDeleteAccessConfigCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/screenshot") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -30871,12 +30701,12 @@ func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.getScreenshot" call. +// Do executes the "compute.instances.deleteAccessConfig" call. // Any non-2xx status code is an error. Response headers are in either -// *Screenshot.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesGetScreenshotCall) Do(opts ...googleapi.CallOption) (*Screenshot, error) { +func (c *InstancesDeleteAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -30895,7 +30725,7 @@ func (c *InstancesGetScreenshotCall) Do(opts ...googleapi.CallOption) (*Screensh if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Screenshot{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -30908,97 +30738,78 @@ func (c *InstancesGetScreenshotCall) Do(opts ...googleapi.CallOption) (*Screensh return ret, nil } -type InstancesGetSerialPortOutputCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// GetSerialPortOutput: Returns the last 1 MB of serial port output from the -// specified instance. -// -// - instance: Name of the instance for this request. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { - c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)} +type InstancesDetachDiskCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// DetachDisk: Detaches a disk from an instance. +// +// - deviceName: The device name of the disk to detach. Make a get() request on +// the instance to view currently attached disks and device names. +// - instance: Instance name for this request. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { + c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance + c.urlParams_.Set("deviceName", deviceName) return c } -// Port sets the optional parameter "port": Specifies which COM or serial port -// to retrieve data from. -func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall { - c.urlParams_.Set("port", fmt.Sprint(port)) - return c -} - -// Start sets the optional parameter "start": Specifies the starting byte -// position of the output to return. To start with the first byte of output to -// the specified port, omit this field or set it to `0`. If the output for that -// byte position is available, this field matches the `start` parameter sent -// with the request. If the amount of serial console output exceeds the size of -// the buffer (1 MB), the oldest output is discarded and is no longer -// available. If the requested start position refers to discarded output, the -// start position is adjusted to the oldest output still available, and the -// adjusted start position is returned as the `start` property value. You can -// also provide a negative start position, which translates to the most recent -// number of bytes written to the serial port. For example, -3 is interpreted -// as the most recent 3 bytes written to the serial console. -func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall { - c.urlParams_.Set("start", fmt.Sprint(start)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesDetachDiskCall) RequestId(requestId string) *InstancesDetachDiskCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall { +func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall { +func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetSerialPortOutputCall) Header() http.Header { +func (c *InstancesDetachDiskCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/serialPort") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/detachDisk") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -31011,13 +30822,12 @@ func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.getSerialPortOutput" call. +// Do executes the "compute.instances.detachDisk" call. // Any non-2xx status code is an error. Response headers are in either -// *SerialPortOutput.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesDetachDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31036,7 +30846,7 @@ func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*Se if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &SerialPortOutput{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31049,7 +30859,7 @@ func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*Se return ret, nil } -type InstancesGetShieldedInstanceIdentityCall struct { +type InstancesGetCall struct { s *Service project string zone string @@ -31060,14 +30870,13 @@ type InstancesGetShieldedInstanceIdentityCall struct { header_ http.Header } -// GetShieldedInstanceIdentity: Returns the Shielded Instance Identity of an -// instance +// Get: Returns the specified Instance resource. // -// - instance: Name or id of the instance scoping this request. +// - instance: Name of the instance resource to return. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall { - c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { + c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance @@ -31077,7 +30886,7 @@ func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone stri // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall { +func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -31085,27 +30894,27 @@ func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall { +func (c *InstancesGetCall) IfNoneMatch(entityTag string) *InstancesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall { +func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesGetShieldedInstanceIdentityCall) Header() http.Header { +func (c *InstancesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -31113,7 +30922,7 @@ func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http. var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -31128,13 +30937,12 @@ func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http. return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.getShieldedInstanceIdentity" call. +// Do executes the "compute.instances.get" call. // Any non-2xx status code is an error. Response headers are in either -// *ShieldedInstanceIdentity.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, error) { +// *Instance.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31153,7 +30961,7 @@ func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ShieldedInstanceIdentity{ + ret := &Instance{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31166,122 +30974,95 @@ func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOpti return ret, nil } -type InstancesInsertCall struct { - s *Service - project string - zone string - instance *Instance - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesGetEffectiveFirewallsCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Insert: Creates an instance resource in the specified project using the data -// included in the request. +// GetEffectiveFirewalls: Returns effective firewalls applied to an interface +// of the instance. // -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { - c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: Name of the instance scoping this request. +// - networkInterface: The name of the network interface to get the effective +// firewalls. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) GetEffectiveFirewalls(project string, zone string, instance string, networkInterface string) *InstancesGetEffectiveFirewallsCall { + c := &InstancesGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// SourceInstanceTemplate sets the optional parameter "sourceInstanceTemplate": -// Specifies instance template to create the instance. This field is optional. -// It can be a full or partial URL. For example, the following are all valid -// URLs to an instance template: - -// https://www.googleapis.com/compute/v1/projects/project -// /global/instanceTemplates/instanceTemplate - -// projects/project/global/instanceTemplates/instanceTemplate - -// global/instanceTemplates/instanceTemplate -func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall { - c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate) - return c -} - -// SourceMachineImage sets the optional parameter "sourceMachineImage": -// Specifies the machine image to use to create the instance. This field is -// optional. It can be a full or partial URL. For example, the following are -// all valid URLs to a machine image: - -// https://www.googleapis.com/compute/v1/projects/project/global/global -// /machineImages/machineImage - -// projects/project/global/global/machineImages/machineImage - -// global/machineImages/machineImage -func (c *InstancesInsertCall) SourceMachineImage(sourceMachineImage string) *InstancesInsertCall { - c.urlParams_.Set("sourceMachineImage", sourceMachineImage) + c.urlParams_.Set("networkInterface", networkInterface) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { +func (c *InstancesGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *InstancesGetEffectiveFirewallsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *InstancesGetEffectiveFirewallsCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { +func (c *InstancesGetEffectiveFirewallsCall) Context(ctx context.Context) *InstancesGetEffectiveFirewallsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesInsertCall) Header() http.Header { +func (c *InstancesGetEffectiveFirewallsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) - if err != nil { - return nil, err +func (c *InstancesGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "zone": c.zone, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.insert" call. +// Do executes the "compute.instances.getEffectiveFirewalls" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *InstancesGetEffectiveFirewallsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*InstancesGetEffectiveFirewallsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31300,7 +31081,7 @@ func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, erro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &InstancesGetEffectiveFirewallsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31313,109 +31094,48 @@ func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, erro return ret, nil } -type InstancesListCall struct { +type InstancesGetGuestAttributesCall struct { s *Service project string zone string + instance string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves the list of instances contained within the specified zone. +// GetGuestAttributes: Returns the specified guest attributes entry. // +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) List(project string, zone string) *InstancesListCall { - c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) GetGuestAttributes(project string, zone string, instance string) *InstancesGetGuestAttributesCall { + c := &InstancesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone + c.instance = instance return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InstancesListCall) Filter(filter string) *InstancesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { - c.urlParams_.Set("pageToken", pageToken) +// QueryPath sets the optional parameter "queryPath": Specifies the guest +// attributes path to be queried. +func (c *InstancesGetGuestAttributesCall) QueryPath(queryPath string) *InstancesGetGuestAttributesCall { + c.urlParams_.Set("queryPath", queryPath) return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *InstancesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// VariableKey sets the optional parameter "variableKey": Specifies the key for +// the guest attributes entry. +func (c *InstancesGetGuestAttributesCall) VariableKey(variableKey string) *InstancesGetGuestAttributesCall { + c.urlParams_.Set("variableKey", variableKey) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { +func (c *InstancesGetGuestAttributesCall) Fields(s ...googleapi.Field) *InstancesGetGuestAttributesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -31423,27 +31143,27 @@ func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { +func (c *InstancesGetGuestAttributesCall) IfNoneMatch(entityTag string) *InstancesGetGuestAttributesCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { +func (c *InstancesGetGuestAttributesCall) Context(ctx context.Context) *InstancesGetGuestAttributesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesListCall) Header() http.Header { +func (c *InstancesGetGuestAttributesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -31451,7 +31171,7 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -31459,18 +31179,20 @@ func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "zone": c.zone, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.list" call. +// Do executes the "compute.instances.getGuestAttributes" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceList.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) { +// *GuestAttributes.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstancesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GuestAttributes, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31489,7 +31211,7 @@ func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceList{ + ret := &GuestAttributes{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31502,138 +31224,42 @@ func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, err return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type InstancesListReferrersCall struct { +type InstancesGetIamPolicyCall struct { s *Service project string zone string - instance string + resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// ListReferrers: Retrieves a list of resources that refer to the VM instance -// specified in the request. For example, if the VM instance is part of a -// managed or unmanaged instance group, the referrers list includes the -// instance group. For more information, read Viewing referrers to VM -// instances. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // -// - instance: Name of the target instance scoping this request, or '-' if the -// request should span over all instances in the container. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall { - c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) GetIamPolicy(project string, zone string, resource string) *InstancesGetIamPolicyCall { + c := &InstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instance = instance - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall { - c.urlParams_.Set("pageToken", pageToken) + c.resource = resource return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *InstancesListReferrersCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesListReferrersCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *InstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstancesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall { +func (c *InstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -31641,27 +31267,27 @@ func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesList // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall { +func (c *InstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *InstancesGetIamPolicyCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall { +func (c *InstancesGetIamPolicyCall) Context(ctx context.Context) *InstancesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesListReferrersCall) Header() http.Header { +func (c *InstancesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -31669,7 +31295,7 @@ func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/referrers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -31679,18 +31305,17 @@ func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, erro googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "instance": c.instance, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.listReferrers" call. +// Do executes the "compute.instances.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceListReferrers.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) { +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31709,7 +31334,7 @@ func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*Instance if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceListReferrers{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31722,96 +31347,72 @@ func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*Instance return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type InstancesPerformMaintenanceCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesGetScreenshotCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// PerformMaintenance: Perform a manual maintenance on the instance. +// GetScreenshot: Returns the screenshot from the specified instance. // // - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) PerformMaintenance(project string, zone string, instance string) *InstancesPerformMaintenanceCall { - c := &InstancesPerformMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) GetScreenshot(project string, zone string, instance string) *InstancesGetScreenshotCall { + c := &InstancesGetScreenshotCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesPerformMaintenanceCall) RequestId(requestId string) *InstancesPerformMaintenanceCall { - c.urlParams_.Set("requestId", requestId) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesPerformMaintenanceCall) Fields(s ...googleapi.Field) *InstancesPerformMaintenanceCall { +func (c *InstancesGetScreenshotCall) Fields(s ...googleapi.Field) *InstancesGetScreenshotCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesGetScreenshotCall) IfNoneMatch(entityTag string) *InstancesGetScreenshotCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesPerformMaintenanceCall) Context(ctx context.Context) *InstancesPerformMaintenanceCall { +func (c *InstancesGetScreenshotCall) Context(ctx context.Context) *InstancesGetScreenshotCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesPerformMaintenanceCall) Header() http.Header { +func (c *InstancesGetScreenshotCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesGetScreenshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/screenshot") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -31824,12 +31425,12 @@ func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.performMaintenance" call. +// Do executes the "compute.instances.getScreenshot" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Screenshot.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesGetScreenshotCall) Do(opts ...googleapi.CallOption) (*Screenshot, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31848,7 +31449,7 @@ func (c *InstancesPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Screenshot{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31861,81 +31462,99 @@ func (c *InstancesPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type InstancesRemoveResourcePoliciesCall struct { - s *Service - project string - zone string - instance string - instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesGetSerialPortOutputCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// RemoveResourcePolicies: Removes resource policies from an instance. +// GetSerialPortOutput: Returns the last 1 MB of serial port output from the +// specified instance. // -// - instance: The instance name for this request. +// - instance: Name of the instance for this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall { - c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { + c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall { - c.urlParams_.Set("requestId", requestId) +// Port sets the optional parameter "port": Specifies which COM or serial port +// to retrieve data from. +func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall { + c.urlParams_.Set("port", fmt.Sprint(port)) + return c +} + +// Start sets the optional parameter "start": Specifies the starting byte +// position of the output to return. To start with the first byte of output to +// the specified port, omit this field or set it to `0`. If the output for that +// byte position is available, this field matches the `start` parameter sent +// with the request. If the amount of serial console output exceeds the size of +// the buffer (1 MB), the oldest output is discarded and is no longer +// available. If the requested start position refers to discarded output, the +// start position is adjusted to the oldest output still available, and the +// adjusted start position is returned as the `start` property value. You can +// also provide a negative start position, which translates to the most recent +// number of bytes written to the serial port. For example, -3 is interpreted +// as the most recent 3 bytes written to the serial console. Note that the +// negative start is bounded by the retained buffer size, and the returned +// serial console output will not exceed the max buffer size. +func (c *InstancesGetSerialPortOutputCall) Start(start int64) *InstancesGetSerialPortOutputCall { + c.urlParams_.Set("start", fmt.Sprint(start)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall { +func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesGetSerialPortOutputCall) IfNoneMatch(entityTag string) *InstancesGetSerialPortOutputCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall { +func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header { +func (c *InstancesGetSerialPortOutputCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest) - if err != nil { - return nil, err +func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/serialPort") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -31948,12 +31567,13 @@ func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.removeResourcePolicies" call. +// Do executes the "compute.instances.getSerialPortOutput" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *SerialPortOutput.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstancesGetSerialPortOutputCall) Do(opts ...googleapi.CallOption) (*SerialPortOutput, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -31972,7 +31592,7 @@ func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &SerialPortOutput{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -31985,76 +31605,73 @@ func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type InstancesResetCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesGetShieldedInstanceIdentityCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Reset: Performs a reset on the instance. This is a hard reset. The VM does -// not do a graceful shutdown. For more information, see Resetting an instance. +// GetShieldedInstanceIdentity: Returns the Shielded Instance Identity of an +// instance // -// - instance: Name of the instance scoping this request. +// - instance: Name or id of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { - c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) GetShieldedInstanceIdentity(project string, zone string, instance string) *InstancesGetShieldedInstanceIdentityCall { + c := &InstancesGetShieldedInstanceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall { - c.urlParams_.Set("requestId", requestId) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall { +func (c *InstancesGetShieldedInstanceIdentityCall) Fields(s ...googleapi.Field) *InstancesGetShieldedInstanceIdentityCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesGetShieldedInstanceIdentityCall) IfNoneMatch(entityTag string) *InstancesGetShieldedInstanceIdentityCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall { +func (c *InstancesGetShieldedInstanceIdentityCall) Context(ctx context.Context) *InstancesGetShieldedInstanceIdentityCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesResetCall) Header() http.Header { +func (c *InstancesGetShieldedInstanceIdentityCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesGetShieldedInstanceIdentityCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/reset") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/getShieldedInstanceIdentity") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -32067,12 +31684,13 @@ func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.reset" call. +// Do executes the "compute.instances.getShieldedInstanceIdentity" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *ShieldedInstanceIdentity.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstancesGetShieldedInstanceIdentityCall) Do(opts ...googleapi.CallOption) (*ShieldedInstanceIdentity, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32091,7 +31709,7 @@ func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ShieldedInstanceIdentity{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32104,24 +31722,23 @@ func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error return ret, nil } -type InstancesResumeCall struct { +type InstancesInsertCall struct { s *Service project string zone string - instance string + instance *Instance urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Resume: Resumes an instance that was suspended using the instances().suspend -// method. +// Insert: Creates an instance resource in the specified project using the data +// included in the request. // -// - instance: Name of the instance resource to resume. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) Resume(project string, zone string, instance string) *InstancesResumeCall { - c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { + c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance @@ -32138,40 +31755,70 @@ func (r *InstancesService) Resume(project string, zone string, instance string) // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall { +func (c *InstancesInsertCall) RequestId(requestId string) *InstancesInsertCall { c.urlParams_.Set("requestId", requestId) return c } +// SourceInstanceTemplate sets the optional parameter "sourceInstanceTemplate": +// Specifies instance template to create the instance. This field is optional. +// It can be a full or partial URL. For example, the following are all valid +// URLs to an instance template: - +// https://www.googleapis.com/compute/v1/projects/project +// /global/instanceTemplates/instanceTemplate - +// projects/project/global/instanceTemplates/instanceTemplate - +// global/instanceTemplates/instanceTemplate +func (c *InstancesInsertCall) SourceInstanceTemplate(sourceInstanceTemplate string) *InstancesInsertCall { + c.urlParams_.Set("sourceInstanceTemplate", sourceInstanceTemplate) + return c +} + +// SourceMachineImage sets the optional parameter "sourceMachineImage": +// Specifies the machine image to use to create the instance. This field is +// optional. It can be a full or partial URL. For example, the following are +// all valid URLs to a machine image: - +// https://www.googleapis.com/compute/v1/projects/project/global/global +// /machineImages/machineImage - +// projects/project/global/global/machineImages/machineImage - +// global/machineImages/machineImage +func (c *InstancesInsertCall) SourceMachineImage(sourceMachineImage string) *InstancesInsertCall { + c.urlParams_.Set("sourceMachineImage", sourceMachineImage) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall { +func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall { +func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesResumeCall) Header() http.Header { +func (c *InstancesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/resume") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -32179,19 +31826,18 @@ func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.resume" call. +// Do executes the "compute.instances.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32223,162 +31869,365 @@ func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, erro return ret, nil } -type InstancesSendDiagnosticInterruptCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesListCall struct { + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SendDiagnosticInterrupt: Sends diagnostic interrupt to the instance. +// List: Retrieves the list of instances contained within the specified zone. // -// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SendDiagnosticInterrupt(project string, zone string, instance string) *InstancesSendDiagnosticInterruptCall { - c := &InstancesSendDiagnosticInterruptCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) List(project string, zone string) *InstancesListCall { + c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instance = instance + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InstancesListCall) Filter(filter string) *InstancesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *InstancesListCall) OrderBy(orderBy string) *InstancesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *InstancesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSendDiagnosticInterruptCall) Fields(s ...googleapi.Field) *InstancesSendDiagnosticInterruptCall { +func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesListCall) IfNoneMatch(entityTag string) *InstancesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesSendDiagnosticInterruptCall) Context(ctx context.Context) *InstancesSendDiagnosticInterruptCall { +func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSendDiagnosticInterruptCall) Header() http.Header { +func (c *InstancesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSendDiagnosticInterruptCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instance": c.instance, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.sendDiagnosticInterrupt" call. -func (c *InstancesSendDiagnosticInterruptCall) Do(opts ...googleapi.CallOption) error { +// Do executes the "compute.instances.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceList.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesListCall) Do(opts ...googleapi.CallOption) (*InstanceList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } if err != nil { - return err + return nil, err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return gensupport.WrapError(err) + return nil, gensupport.WrapError(err) } - return nil + ret := &InstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil } -type InstancesSetDeletionProtectionCall struct { - s *Service - project string - zone string - resource string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *InstancesListCall) Pages(ctx context.Context, f func(*InstanceList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// SetDeletionProtection: Sets deletion protection on the instance. +type InstancesListReferrersCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListReferrers: Retrieves a list of resources that refer to the VM instance +// specified in the request. For example, if the VM instance is part of a +// managed or unmanaged instance group, the referrers list includes the +// instance group. For more information, read Viewing referrers to VM +// instances. // -// - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall { - c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: Name of the target instance scoping this request, or '-' if the +// request should span over all instances in the container. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) ListReferrers(project string, zone string, instance string) *InstancesListReferrersCall { + c := &InstancesListReferrersCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource + c.instance = instance return c } -// DeletionProtection sets the optional parameter "deletionProtection": Whether -// the resource should be protected against deletion. -func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall { - c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection)) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InstancesListReferrersCall) Filter(filter string) *InstancesListReferrersCall { + c.urlParams_.Set("filter", filter) return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall { - c.urlParams_.Set("requestId", requestId) +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InstancesListReferrersCall) MaxResults(maxResults int64) *InstancesListReferrersCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *InstancesListReferrersCall) OrderBy(orderBy string) *InstancesListReferrersCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *InstancesListReferrersCall) PageToken(pageToken string) *InstancesListReferrersCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *InstancesListReferrersCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstancesListReferrersCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall { +func (c *InstancesListReferrersCall) Fields(s ...googleapi.Field) *InstancesListReferrersCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstancesListReferrersCall) IfNoneMatch(entityTag string) *InstancesListReferrersCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall { +func (c *InstancesListReferrersCall) Context(ctx context.Context) *InstancesListReferrersCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetDeletionProtectionCall) Header() http.Header { +func (c *InstancesListReferrersCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesListReferrersCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/referrers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -32386,17 +32235,18 @@ func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Respon googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "resource": c.resource, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setDeletionProtection" call. +// Do executes the "compute.instances.listReferrers" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *InstanceListReferrers.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstancesListReferrersCall) Do(opts ...googleapi.CallOption) (*InstanceListReferrers, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32415,7 +32265,7 @@ func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &InstanceListReferrers{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32428,7 +32278,28 @@ func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type InstancesSetDiskAutoDeleteCall struct { +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *InstancesListReferrersCall) Pages(ctx context.Context, f func(*InstanceListReferrers) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type InstancesPerformMaintenanceCall struct { s *Service project string zone string @@ -32438,22 +32309,16 @@ type InstancesSetDiskAutoDeleteCall struct { header_ http.Header } -// SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to an -// instance. +// PerformMaintenance: Perform a manual maintenance on the instance. // -// - autoDelete: Whether to auto-delete the disk when the instance is deleted. -// - deviceName: The device name of the disk to modify. Make a get() request on -// the instance to view currently attached disks and device names. -// - instance: The instance name for this request. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall { - c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: Name of the instance scoping this request. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) PerformMaintenance(project string, zone string, instance string) *InstancesPerformMaintenanceCall { + c := &InstancesPerformMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete)) - c.urlParams_.Set("deviceName", deviceName) return c } @@ -32467,7 +32332,7 @@ func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instan // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall { +func (c *InstancesPerformMaintenanceCall) RequestId(requestId string) *InstancesPerformMaintenanceCall { c.urlParams_.Set("requestId", requestId) return c } @@ -32475,32 +32340,32 @@ func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesS // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall { +func (c *InstancesPerformMaintenanceCall) Fields(s ...googleapi.Field) *InstancesPerformMaintenanceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall { +func (c *InstancesPerformMaintenanceCall) Context(ctx context.Context) *InstancesPerformMaintenanceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header { +func (c *InstancesPerformMaintenanceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/performMaintenance") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -32515,12 +32380,12 @@ func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setDiskAutoDelete" call. +// Do executes the "compute.instances.performMaintenance" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32552,65 +32417,79 @@ func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type InstancesSetIamPolicyCall struct { - s *Service - project string - zone string - resource string - zonesetpolicyrequest *ZoneSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesRemoveResourcePoliciesCall struct { + s *Service + project string + zone string + instance string + instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// RemoveResourcePolicies: Removes resource policies from an instance. // +// - instance: The instance name for this request. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall { - c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) RemoveResourcePolicies(project string, zone string, instance string, instancesremoveresourcepoliciesrequest *InstancesRemoveResourcePoliciesRequest) *InstancesRemoveResourcePoliciesCall { + c := &InstancesRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.zonesetpolicyrequest = zonesetpolicyrequest + c.instance = instance + c.instancesremoveresourcepoliciesrequest = instancesremoveresourcepoliciesrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesRemoveResourcePoliciesCall) RequestId(requestId string) *InstancesRemoveResourcePoliciesCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall { +func (c *InstancesRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *InstancesRemoveResourcePoliciesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall { +func (c *InstancesRemoveResourcePoliciesCall) Context(ctx context.Context) *InstancesRemoveResourcePoliciesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetIamPolicyCall) Header() http.Header { +func (c *InstancesRemoveResourcePoliciesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesremoveresourcepoliciesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/removeResourcePolicies") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -32620,17 +32499,17 @@ func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "resource": c.resource, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setIamPolicy" call. +// Do executes the "compute.instances.removeResourcePolicies" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *InstancesRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32649,7 +32528,7 @@ func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -32662,29 +32541,27 @@ func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, e return ret, nil } -type InstancesSetLabelsCall struct { - s *Service - project string - zone string - instance string - instancessetlabelsrequest *InstancesSetLabelsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesResetCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetLabels: Sets labels on an instance. To learn more about labels, read the -// Labeling Resources documentation. +// Reset: Performs a reset on the instance. This is a hard reset. The VM does +// not do a graceful shutdown. For more information, see Resetting an instance. // // - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall { - c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { + c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancessetlabelsrequest = instancessetlabelsrequest return c } @@ -32698,7 +32575,7 @@ func (r *InstancesService) SetLabels(project string, zone string, instance strin // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall { +func (c *InstancesResetCall) RequestId(requestId string) *InstancesResetCall { c.urlParams_.Set("requestId", requestId) return c } @@ -32706,36 +32583,32 @@ func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabels // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall { +func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall { +func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetLabelsCall) Header() http.Header { +func (c *InstancesResetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setLabels") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/reset") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -32750,12 +32623,12 @@ func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setLabels" call. +// Do executes the "compute.instances.reset" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32787,29 +32660,27 @@ func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, e return ret, nil } -type InstancesSetMachineResourcesCall struct { - s *Service - project string - zone string - instance string - instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesResumeCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMachineResources: Changes the number and/or type of accelerator for a -// stopped instance to the values specified in the request. +// Resume: Resumes an instance that was suspended using the instances().suspend +// method. // -// - instance: Name of the instance scoping this request. +// - instance: Name of the instance resource to resume. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall { - c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Resume(project string, zone string, instance string) *InstancesResumeCall { + c := &InstancesResumeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest return c } @@ -32823,7 +32694,7 @@ func (r *InstancesService) SetMachineResources(project string, zone string, inst // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall { +func (c *InstancesResumeCall) RequestId(requestId string) *InstancesResumeCall { c.urlParams_.Set("requestId", requestId) return c } @@ -32831,36 +32702,32 @@ func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *Instance // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall { +func (c *InstancesResumeCall) Fields(s ...googleapi.Field) *InstancesResumeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall { +func (c *InstancesResumeCall) Context(ctx context.Context) *InstancesResumeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetMachineResourcesCall) Header() http.Header { +func (c *InstancesResumeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesResumeCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMachineResources") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/resume") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -32875,12 +32742,12 @@ func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setMachineResources" call. +// Do executes the "compute.instances.resume" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesResumeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -32912,80 +32779,58 @@ func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type InstancesSetMachineTypeCall struct { - s *Service - project string - zone string - instance string - instancessetmachinetyperequest *InstancesSetMachineTypeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSendDiagnosticInterruptCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMachineType: Changes the machine type for a stopped instance to the -// machine type specified in the request. +// SendDiagnosticInterrupt: Sends diagnostic interrupt to the instance. // // - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall { - c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SendDiagnosticInterrupt(project string, zone string, instance string) *InstancesSendDiagnosticInterruptCall { + c := &InstancesSendDiagnosticInterruptCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancessetmachinetyperequest = instancessetmachinetyperequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall { - c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall { +func (c *InstancesSendDiagnosticInterruptCall) Fields(s ...googleapi.Field) *InstancesSendDiagnosticInterruptCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall { +func (c *InstancesSendDiagnosticInterruptCall) Context(ctx context.Context) *InstancesSendDiagnosticInterruptCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetMachineTypeCall) Header() http.Header { +func (c *InstancesSendDiagnosticInterruptCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesSendDiagnosticInterruptCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMachineType") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/sendDiagnosticInterrupt") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33000,72 +32845,53 @@ func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setMachineType" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// Do executes the "compute.instances.sendDiagnosticInterrupt" call. +func (c *InstancesSendDiagnosticInterruptCall) Do(opts ...googleapi.CallOption) error { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } if err != nil { - return nil, err + return err } defer googleapi.CloseBody(res) if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err + return gensupport.WrapError(err) } - return ret, nil + return nil } -type InstancesSetMetadataCall struct { +type InstancesSetDeletionProtectionCall struct { s *Service project string zone string - instance string - metadata *Metadata + resource string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// SetMetadata: Sets metadata for the specified instance to the data included -// in the request. +// SetDeletionProtection: Sets deletion protection on the instance. // -// - instance: Name of the instance scoping this request. // - project: Project ID for this request. +// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { - c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetDeletionProtection(project string, zone string, resource string) *InstancesSetDeletionProtectionCall { + c := &InstancesSetDeletionProtectionCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instance = instance - c.metadata = metadata + c.resource = resource return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already +// DeletionProtection sets the optional parameter "deletionProtection": Whether +// the resource should be protected against deletion. +func (c *InstancesSetDeletionProtectionCall) DeletionProtection(deletionProtection bool) *InstancesSetDeletionProtectionCall { + c.urlParams_.Set("deletionProtection", fmt.Sprint(deletionProtection)) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already // been completed. For example, consider a situation where you make an initial // request and the request times out. If you make the request again with the // same request ID, the server can check if original operation with the same @@ -33073,7 +32899,7 @@ func (r *InstancesService) SetMetadata(project string, zone string, instance str // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall { +func (c *InstancesSetDeletionProtectionCall) RequestId(requestId string) *InstancesSetDeletionProtectionCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33081,36 +32907,32 @@ func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMeta // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall { +func (c *InstancesSetDeletionProtectionCall) Fields(s ...googleapi.Field) *InstancesSetDeletionProtectionCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall { +func (c *InstancesSetDeletionProtectionCall) Context(ctx context.Context) *InstancesSetDeletionProtectionCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetMetadataCall) Header() http.Header { +func (c *InstancesSetDeletionProtectionCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesSetDeletionProtectionCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMetadata") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33120,17 +32942,17 @@ func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "instance": c.instance, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setMetadata" call. +// Do executes the "compute.instances.setDeletionProtection" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetDeletionProtectionCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33162,30 +32984,32 @@ func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type InstancesSetMinCpuPlatformCall struct { - s *Service - project string - zone string - instance string - instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetDiskAutoDeleteCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetMinCpuPlatform: Changes the minimum CPU platform that this instance -// should use. This method can only be called on a stopped instance. For more -// information, read Specifying a Minimum CPU Platform. +// SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to an +// instance. // -// - instance: Name of the instance scoping this request. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall { - c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - autoDelete: Whether to auto-delete the disk when the instance is deleted. +// - deviceName: The device name of the disk to modify. Make a get() request on +// the instance to view currently attached disks and device names. +// - instance: The instance name for this request. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall { + c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest + c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete)) + c.urlParams_.Set("deviceName", deviceName) return c } @@ -33199,7 +33023,7 @@ func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instan // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall { +func (c *InstancesSetDiskAutoDeleteCall) RequestId(requestId string) *InstancesSetDiskAutoDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33207,36 +33031,32 @@ func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesS // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall { +func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall { +func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetMinCpuPlatformCall) Header() http.Header { +func (c *InstancesSetDiskAutoDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33251,12 +33071,12 @@ func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setMinCpuPlatform" call. +// Do executes the "compute.instances.setDiskAutoDelete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetDiskAutoDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33288,79 +33108,65 @@ func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type InstancesSetNameCall struct { - s *Service - project string - zone string - instance string - instancessetnamerequest *InstancesSetNameRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetIamPolicyCall struct { + s *Service + project string + zone string + resource string + zonesetpolicyrequest *ZoneSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetName: Sets name of an instance. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - instance: The instance name for this request. // - project: Project ID for this request. +// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetName(project string, zone string, instance string, instancessetnamerequest *InstancesSetNameRequest) *InstancesSetNameCall { - c := &InstancesSetNameCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstancesSetIamPolicyCall { + c := &InstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instance = instance - c.instancessetnamerequest = instancessetnamerequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetNameCall) RequestId(requestId string) *InstancesSetNameCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.zonesetpolicyrequest = zonesetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetNameCall) Fields(s ...googleapi.Field) *InstancesSetNameCall { +func (c *InstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *InstancesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetNameCall) Context(ctx context.Context) *InstancesSetNameCall { +func (c *InstancesSetIamPolicyCall) Context(ctx context.Context) *InstancesSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetNameCall) Header() http.Header { +func (c *InstancesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetnamerequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setName") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33370,17 +33176,17 @@ func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "instance": c.instance, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setName" call. +// Do executes the "compute.instances.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetNameCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33399,7 +33205,7 @@ func (c *InstancesSetNameCall) Do(opts ...googleapi.CallOption) (*Operation, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -33412,32 +33218,29 @@ func (c *InstancesSetNameCall) Do(opts ...googleapi.CallOption) (*Operation, err return ret, nil } -type InstancesSetSchedulingCall struct { - s *Service - project string - zone string - instance string - scheduling *Scheduling - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetLabelsCall struct { + s *Service + project string + zone string + instance string + instancessetlabelsrequest *InstancesSetLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetScheduling: Sets an instance's scheduling options. You can only call this -// method on a stopped instance, that is, a VM instance that is in a -// `TERMINATED` state. See Instance Life Cycle for more information on the -// possible instance states. For more information about setting scheduling -// options for a VM, see Set VM host maintenance policy. +// SetLabels: Sets labels on an instance. To learn more about labels, read the +// Labeling Resources documentation. // -// - instance: Instance name for this request. +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall { - c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetLabels(project string, zone string, instance string, instancessetlabelsrequest *InstancesSetLabelsRequest) *InstancesSetLabelsCall { + c := &InstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.scheduling = scheduling + c.instancessetlabelsrequest = instancessetlabelsrequest return c } @@ -33451,7 +33254,7 @@ func (r *InstancesService) SetScheduling(project string, zone string, instance s // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall { +func (c *InstancesSetLabelsCall) RequestId(requestId string) *InstancesSetLabelsCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33459,36 +33262,36 @@ func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSc // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall { +func (c *InstancesSetLabelsCall) Fields(s ...googleapi.Field) *InstancesSetLabelsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall { +func (c *InstancesSetLabelsCall) Context(ctx context.Context) *InstancesSetLabelsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetSchedulingCall) Header() http.Header { +func (c *InstancesSetLabelsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetlabelsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setScheduling") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setLabels") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33503,12 +33306,12 @@ func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setScheduling" call. +// Do executes the "compute.instances.setLabels" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33540,30 +33343,29 @@ func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type InstancesSetSecurityPolicyCall struct { - s *Service - project string - zone string - instance string - instancessetsecuritypolicyrequest *InstancesSetSecurityPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetMachineResourcesCall struct { + s *Service + project string + zone string + instance string + instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetSecurityPolicy: Sets the Google Cloud Armor security policy for the -// specified instance. For more information, see Google Cloud Armor Overview +// SetMachineResources: Changes the number and/or type of accelerator for a +// stopped instance to the values specified in the request. // -// - instance: Name of the Instance resource to which the security policy -// should be set. The name should conform to RFC1035. -// - project: Project ID for this request. -// - zone: Name of the zone scoping this request. -func (r *InstancesService) SetSecurityPolicy(project string, zone string, instance string, instancessetsecuritypolicyrequest *InstancesSetSecurityPolicyRequest) *InstancesSetSecurityPolicyCall { - c := &InstancesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: Name of the instance scoping this request. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) SetMachineResources(project string, zone string, instance string, instancessetmachineresourcesrequest *InstancesSetMachineResourcesRequest) *InstancesSetMachineResourcesCall { + c := &InstancesSetMachineResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancessetsecuritypolicyrequest = instancessetsecuritypolicyrequest + c.instancessetmachineresourcesrequest = instancessetmachineresourcesrequest return c } @@ -33577,7 +33379,7 @@ func (r *InstancesService) SetSecurityPolicy(project string, zone string, instan // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetSecurityPolicyCall) RequestId(requestId string) *InstancesSetSecurityPolicyCall { +func (c *InstancesSetMachineResourcesCall) RequestId(requestId string) *InstancesSetMachineResourcesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33585,36 +33387,36 @@ func (c *InstancesSetSecurityPolicyCall) RequestId(requestId string) *InstancesS // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetSecurityPolicyCall { +func (c *InstancesSetMachineResourcesCall) Fields(s ...googleapi.Field) *InstancesSetMachineResourcesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetSecurityPolicyCall) Context(ctx context.Context) *InstancesSetSecurityPolicyCall { +func (c *InstancesSetMachineResourcesCall) Context(ctx context.Context) *InstancesSetMachineResourcesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetSecurityPolicyCall) Header() http.Header { +func (c *InstancesSetMachineResourcesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetMachineResourcesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetsecuritypolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachineresourcesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMachineResources") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33629,12 +33431,12 @@ func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setSecurityPolicy" call. +// Do executes the "compute.instances.setMachineResources" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetMachineResourcesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33666,30 +33468,29 @@ func (c *InstancesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type InstancesSetServiceAccountCall struct { - s *Service - project string - zone string - instance string - instancessetserviceaccountrequest *InstancesSetServiceAccountRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetMachineTypeCall struct { + s *Service + project string + zone string + instance string + instancessetmachinetyperequest *InstancesSetMachineTypeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetServiceAccount: Sets the service account on the instance. For more -// information, read Changing the service account and access scopes for an -// instance. +// SetMachineType: Changes the machine type for a stopped instance to the +// machine type specified in the request. // -// - instance: Name of the instance resource to start. +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall { - c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetMachineType(project string, zone string, instance string, instancessetmachinetyperequest *InstancesSetMachineTypeRequest) *InstancesSetMachineTypeCall { + c := &InstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancessetserviceaccountrequest = instancessetserviceaccountrequest + c.instancessetmachinetyperequest = instancessetmachinetyperequest return c } @@ -33703,7 +33504,7 @@ func (r *InstancesService) SetServiceAccount(project string, zone string, instan // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall { +func (c *InstancesSetMachineTypeCall) RequestId(requestId string) *InstancesSetMachineTypeCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33711,36 +33512,36 @@ func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesS // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall { +func (c *InstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *InstancesSetMachineTypeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall { +func (c *InstancesSetMachineTypeCall) Context(ctx context.Context) *InstancesSetMachineTypeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetServiceAccountCall) Header() http.Header { +func (c *InstancesSetMachineTypeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmachinetyperequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMachineType") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -33755,12 +33556,12 @@ func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setServiceAccount" call. +// Do executes the "compute.instances.setMachineType" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33792,31 +33593,29 @@ func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type InstancesSetShieldedInstanceIntegrityPolicyCall struct { - s *Service - project string - zone string - instance string - shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetMetadataCall struct { + s *Service + project string + zone string + instance string + metadata *Metadata + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance integrity -// policy for an instance. You can only use this method on a running instance. -// This method supports PATCH semantics and uses the JSON merge patch format -// and processing rules. +// SetMetadata: Sets metadata for the specified instance to the data included +// in the request. // -// - instance: Name or id of the instance scoping this request. +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall { - c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { + c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy + c.metadata = metadata return c } @@ -33830,7 +33629,7 @@ func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zo // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall { +func (c *InstancesSetMetadataCall) RequestId(requestId string) *InstancesSetMetadataCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33838,38 +33637,38 @@ func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId st // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall { +func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall { +func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header { +func (c *InstancesSetMetadataCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMetadata") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -33882,12 +33681,12 @@ func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" call. +// Do executes the "compute.instances.setMetadata" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -33919,29 +33718,30 @@ func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.C return ret, nil } -type InstancesSetTagsCall struct { - s *Service - project string - zone string - instance string - tags *Tags - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetMinCpuPlatformCall struct { + s *Service + project string + zone string + instance string + instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetTags: Sets network tags for the specified instance to the data included -// in the request. +// SetMinCpuPlatform: Changes the minimum CPU platform that this instance +// should use. This method can only be called on a stopped instance. For more +// information, read Specifying a Minimum CPU Platform. // // - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { - c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetMinCpuPlatform(project string, zone string, instance string, instancessetmincpuplatformrequest *InstancesSetMinCpuPlatformRequest) *InstancesSetMinCpuPlatformCall { + c := &InstancesSetMinCpuPlatformCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.tags = tags + c.instancessetmincpuplatformrequest = instancessetmincpuplatformrequest return c } @@ -33955,7 +33755,7 @@ func (r *InstancesService) SetTags(project string, zone string, instance string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall { +func (c *InstancesSetMinCpuPlatformCall) RequestId(requestId string) *InstancesSetMinCpuPlatformCall { c.urlParams_.Set("requestId", requestId) return c } @@ -33963,36 +33763,36 @@ func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall { +func (c *InstancesSetMinCpuPlatformCall) Fields(s ...googleapi.Field) *InstancesSetMinCpuPlatformCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall { +func (c *InstancesSetMinCpuPlatformCall) Context(ctx context.Context) *InstancesSetMinCpuPlatformCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSetTagsCall) Header() http.Header { +func (c *InstancesSetMinCpuPlatformCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetMinCpuPlatformCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetmincpuplatformrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setTags") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34007,12 +33807,12 @@ func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.setTags" call. +// Do executes the "compute.instances.setMinCpuPlatform" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetMinCpuPlatformCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34044,27 +33844,28 @@ func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, err return ret, nil } -type InstancesSimulateMaintenanceEventCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetNameCall struct { + s *Service + project string + zone string + instance string + instancessetnamerequest *InstancesSetNameRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SimulateMaintenanceEvent: Simulates a host maintenance event on a VM. For -// more information, see Simulate a host maintenance event. +// SetName: Sets name of an instance. // -// - instance: Name of the instance scoping this request. +// - instance: The instance name for this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall { - c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetName(project string, zone string, instance string, instancessetnamerequest *InstancesSetNameRequest) *InstancesSetNameCall { + c := &InstancesSetNameCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance + c.instancessetnamerequest = instancessetnamerequest return c } @@ -34078,48 +33879,44 @@ func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSimulateMaintenanceEventCall) RequestId(requestId string) *InstancesSimulateMaintenanceEventCall { +func (c *InstancesSetNameCall) RequestId(requestId string) *InstancesSetNameCall { c.urlParams_.Set("requestId", requestId) return c } -// WithExtendedNotifications sets the optional parameter -// "withExtendedNotifications": Determines whether the customers receive -// notifications before migration. Only applicable to SF vms. -func (c *InstancesSimulateMaintenanceEventCall) WithExtendedNotifications(withExtendedNotifications bool) *InstancesSimulateMaintenanceEventCall { - c.urlParams_.Set("withExtendedNotifications", fmt.Sprint(withExtendedNotifications)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall { +func (c *InstancesSetNameCall) Fields(s ...googleapi.Field) *InstancesSetNameCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall { +func (c *InstancesSetNameCall) Context(ctx context.Context) *InstancesSetNameCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header { +func (c *InstancesSetNameCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesSetNameCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetnamerequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setName") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34134,12 +33931,12 @@ func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.simulateMaintenanceEvent" call. +// Do executes the "compute.instances.setName" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetNameCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34171,27 +33968,32 @@ func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) return ret, nil } -type InstancesStartCall struct { +type InstancesSetSchedulingCall struct { s *Service project string zone string instance string + scheduling *Scheduling urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Start: Starts an instance that was stopped using the instances().stop -// method. For more information, see Restart an instance. +// SetScheduling: Sets an instance's scheduling options. You can only call this +// method on a stopped instance, that is, a VM instance that is in a +// `TERMINATED` state. See Instance Life Cycle for more information on the +// possible instance states. For more information about setting scheduling +// options for a VM, see Set VM host maintenance policy. // -// - instance: Name of the instance resource to start. +// - instance: Instance name for this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall { - c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall { + c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance + c.scheduling = scheduling return c } @@ -34205,7 +34007,7 @@ func (r *InstancesService) Start(project string, zone string, instance string) * // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall { +func (c *InstancesSetSchedulingCall) RequestId(requestId string) *InstancesSetSchedulingCall { c.urlParams_.Set("requestId", requestId) return c } @@ -34213,32 +34015,36 @@ func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall { +func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall { +func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesStartCall) Header() http.Header { +func (c *InstancesSetSchedulingCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/start") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setScheduling") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34253,12 +34059,12 @@ func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.start" call. +// Do executes the "compute.instances.setScheduling" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetSchedulingCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34290,29 +34096,30 @@ func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error return ret, nil } -type InstancesStartWithEncryptionKeyCall struct { - s *Service - project string - zone string - instance string - instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetSecurityPolicyCall struct { + s *Service + project string + zone string + instance string + instancessetsecuritypolicyrequest *InstancesSetSecurityPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// StartWithEncryptionKey: Starts an instance that was stopped using the -// instances().stop method. For more information, see Restart an instance. +// SetSecurityPolicy: Sets the Google Cloud Armor security policy for the +// specified instance. For more information, see Google Cloud Armor Overview // -// - instance: Name of the instance resource to start. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall { - c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: Name of the Instance resource to which the security policy +// should be set. The name should conform to RFC1035. +// - project: Project ID for this request. +// - zone: Name of the zone scoping this request. +func (r *InstancesService) SetSecurityPolicy(project string, zone string, instance string, instancessetsecuritypolicyrequest *InstancesSetSecurityPolicyRequest) *InstancesSetSecurityPolicyCall { + c := &InstancesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest + c.instancessetsecuritypolicyrequest = instancessetsecuritypolicyrequest return c } @@ -34326,7 +34133,7 @@ func (r *InstancesService) StartWithEncryptionKey(project string, zone string, i // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall { +func (c *InstancesSetSecurityPolicyCall) RequestId(requestId string) *InstancesSetSecurityPolicyCall { c.urlParams_.Set("requestId", requestId) return c } @@ -34334,36 +34141,36 @@ func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *Insta // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall { +func (c *InstancesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetSecurityPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall { +func (c *InstancesSetSecurityPolicyCall) Context(ctx context.Context) *InstancesSetSecurityPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header { +func (c *InstancesSetSecurityPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetsecuritypolicyrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setSecurityPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34378,12 +34185,12 @@ func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.startWithEncryptionKey" call. +// Do executes the "compute.instances.setSecurityPolicy" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34415,40 +34222,30 @@ func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type InstancesStopCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetServiceAccountCall struct { + s *Service + project string + zone string + instance string + instancessetserviceaccountrequest *InstancesSetServiceAccountRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Stop: Stops a running instance, shutting it down cleanly, and allows you to -// restart the instance at a later time. Stopped instances do not incur VM -// usage charges while they are stopped. However, resources that the VM is -// using, such as persistent disks and static IP addresses, will continue to be -// charged until they are deleted. For more information, see Stopping an +// SetServiceAccount: Sets the service account on the instance. For more +// information, read Changing the service account and access scopes for an // instance. // -// - instance: Name of the instance resource to stop. +// - instance: Name of the instance resource to start. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall { - c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetServiceAccount(project string, zone string, instance string, instancessetserviceaccountrequest *InstancesSetServiceAccountRequest) *InstancesSetServiceAccountCall { + c := &InstancesSetServiceAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - return c -} - -// DiscardLocalSsd sets the optional parameter "discardLocalSsd": This property -// is required if the instance has any attached Local SSD disks. If false, -// Local SSD data will be preserved when the instance is suspended. If true, -// the contents of any attached Local SSD disks will be discarded. -func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall { - c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd)) + c.instancessetserviceaccountrequest = instancessetserviceaccountrequest return c } @@ -34462,7 +34259,7 @@ func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStop // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall { +func (c *InstancesSetServiceAccountCall) RequestId(requestId string) *InstancesSetServiceAccountCall { c.urlParams_.Set("requestId", requestId) return c } @@ -34470,32 +34267,36 @@ func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall { +func (c *InstancesSetServiceAccountCall) Fields(s ...googleapi.Field) *InstancesSetServiceAccountCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall { +func (c *InstancesSetServiceAccountCall) Context(ctx context.Context) *InstancesSetServiceAccountCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesStopCall) Header() http.Header { +func (c *InstancesSetServiceAccountCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesSetServiceAccountCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancessetserviceaccountrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/stop") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34510,12 +34311,12 @@ func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.stop" call. +// Do executes the "compute.instances.setServiceAccount" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetServiceAccountCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34547,41 +34348,31 @@ func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) return ret, nil } -type InstancesSuspendCall struct { - s *Service - project string - zone string - instance string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetShieldedInstanceIntegrityPolicyCall struct { + s *Service + project string + zone string + instance string + shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Suspend: This method suspends a running instance, saving its state to -// persistent storage, and allows you to resume the instance at a later time. -// Suspended instances have no compute costs (cores or RAM), and incur only -// storage charges for the saved VM memory and localSSD data. Any charged -// resources the virtual machine was using, such as persistent disks and static -// IP addresses, will continue to be charged while the instance is suspended. -// For more information, see Suspending and resuming an instance. +// SetShieldedInstanceIntegrityPolicy: Sets the Shielded Instance integrity +// policy for an instance. You can only use this method on a running instance. +// This method supports PATCH semantics and uses the JSON merge patch format +// and processing rules. // -// - instance: Name of the instance resource to suspend. +// - instance: Name or id of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall { - c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetShieldedInstanceIntegrityPolicy(project string, zone string, instance string, shieldedinstanceintegritypolicy *ShieldedInstanceIntegrityPolicy) *InstancesSetShieldedInstanceIntegrityPolicyCall { + c := &InstancesSetShieldedInstanceIntegrityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - return c -} - -// DiscardLocalSsd sets the optional parameter "discardLocalSsd": This property -// is required if the instance has any attached Local SSD disks. If false, -// Local SSD data will be preserved when the instance is suspended. If true, -// the contents of any attached Local SSD disks will be discarded. -func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall { - c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd)) + c.shieldedinstanceintegritypolicy = shieldedinstanceintegritypolicy return c } @@ -34595,7 +34386,7 @@ func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesS // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall { +func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) RequestId(requestId string) *InstancesSetShieldedInstanceIntegrityPolicyCall { c.urlParams_.Set("requestId", requestId) return c } @@ -34603,34 +34394,38 @@ func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall { +func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Fields(s ...googleapi.Field) *InstancesSetShieldedInstanceIntegrityPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall { +func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Context(ctx context.Context) *InstancesSetShieldedInstanceIntegrityPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesSuspendCall) Header() http.Header { +func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceintegritypolicy) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/suspend") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setShieldedInstanceIntegrityPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -34643,12 +34438,12 @@ func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.suspend" call. +// Do executes the "compute.instances.setShieldedInstanceIntegrityPolicy" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSetShieldedInstanceIntegrityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34680,65 +34475,80 @@ func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, err return ret, nil } -type InstancesTestIamPermissionsCall struct { - s *Service - project string - zone string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSetTagsCall struct { + s *Service + project string + zone string + instance string + tags *Tags + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// SetTags: Sets network tags for the specified instance to the data included +// in the request. // +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall { - c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { + c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.instance = instance + c.tags = tags + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesSetTagsCall) RequestId(requestId string) *InstancesSetTagsCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall { +func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall { +func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesTestIamPermissionsCall) Header() http.Header { +func (c *InstancesSetTagsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/setTags") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -34748,18 +34558,17 @@ func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "resource": c.resource, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.testIamPermissions" call. +// Do executes the "compute.instances.setTags" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesSetTagsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34778,7 +34587,7 @@ func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*Tes if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -34791,64 +34600,27 @@ func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*Tes return ret, nil } -type InstancesUpdateCall struct { +type InstancesSimulateMaintenanceEventCall struct { s *Service project string zone string instance string - instance2 *Instance urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates an instance only if the necessary resources are available. -// This method can update only a specific set of instance properties. See -// Updating a running instance for a list of updatable instance properties. +// SimulateMaintenanceEvent: Simulates a host maintenance event on a VM. For +// more information, see Simulate a host maintenance event. // -// - instance: Name of the instance resource to update. +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) Update(project string, zone string, instance string, instance2 *Instance) *InstancesUpdateCall { - c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) SimulateMaintenanceEvent(project string, zone string, instance string) *InstancesSimulateMaintenanceEventCall { + c := &InstancesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.instance2 = instance2 - return c -} - -// MinimalAction sets the optional parameter "minimalAction": Specifies the -// action to take when updating an instance even if the updated properties do -// not require it. If not specified, then Compute Engine acts based on the -// minimum action that the updated properties require. -// -// Possible values: -// -// "INVALID" -// "NO_EFFECT" - No changes can be made to the instance. -// "REFRESH" - The instance will not restart. -// "RESTART" - The instance will restart. -func (c *InstancesUpdateCall) MinimalAction(minimalAction string) *InstancesUpdateCall { - c.urlParams_.Set("minimalAction", minimalAction) - return c -} - -// MostDisruptiveAllowedAction sets the optional parameter -// "mostDisruptiveAllowedAction": Specifies the most disruptive action that can -// be taken on the instance as part of the update. Compute Engine returns an -// error if the instance properties require a more disruptive action as part of -// the instance update. Valid options from lowest to highest are NO_EFFECT, -// REFRESH, and RESTART. -// -// Possible values: -// -// "INVALID" -// "NO_EFFECT" - No changes can be made to the instance. -// "REFRESH" - The instance will not restart. -// "RESTART" - The instance will restart. -func (c *InstancesUpdateCall) MostDisruptiveAllowedAction(mostDisruptiveAllowedAction string) *InstancesUpdateCall { - c.urlParams_.Set("mostDisruptiveAllowedAction", mostDisruptiveAllowedAction) return c } @@ -34862,46 +34634,50 @@ func (c *InstancesUpdateCall) MostDisruptiveAllowedAction(mostDisruptiveAllowedA // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesUpdateCall) RequestId(requestId string) *InstancesUpdateCall { +func (c *InstancesSimulateMaintenanceEventCall) RequestId(requestId string) *InstancesSimulateMaintenanceEventCall { c.urlParams_.Set("requestId", requestId) return c } +// WithExtendedNotifications sets the optional parameter +// "withExtendedNotifications": Determines whether the customers receive +// notifications before migration. Only applicable to SF vms. +func (c *InstancesSimulateMaintenanceEventCall) WithExtendedNotifications(withExtendedNotifications bool) *InstancesSimulateMaintenanceEventCall { + c.urlParams_.Set("withExtendedNotifications", fmt.Sprint(withExtendedNotifications)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { +func (c *InstancesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *InstancesSimulateMaintenanceEventCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { +func (c *InstancesSimulateMaintenanceEventCall) Context(ctx context.Context) *InstancesSimulateMaintenanceEventCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesUpdateCall) Header() http.Header { +func (c *InstancesSimulateMaintenanceEventCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance2) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -34914,12 +34690,12 @@ func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.update" call. +// Do executes the "compute.instances.simulateMaintenanceEvent" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -34951,34 +34727,27 @@ func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, erro return ret, nil } -type InstancesUpdateAccessConfigCall struct { - s *Service - project string - zone string - instance string - accessconfig *AccessConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesStartCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateAccessConfig: Updates the specified access config from an instance's -// network interface with the data included in the request. This method -// supports PATCH semantics and uses the JSON merge patch format and processing -// rules. +// Start: Starts an instance that was stopped using the instances().stop +// method. For more information, see Restart an instance. // -// - instance: The instance name for this request. -// - networkInterface: The name of the network interface where the access -// config is attached. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall { - c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: Name of the instance resource to start. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall { + c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.urlParams_.Set("networkInterface", networkInterface) - c.accessconfig = accessconfig return c } @@ -34992,7 +34761,7 @@ func (r *InstancesService) UpdateAccessConfig(project string, zone string, insta // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall { +func (c *InstancesStartCall) RequestId(requestId string) *InstancesStartCall { c.urlParams_.Set("requestId", requestId) return c } @@ -35000,36 +34769,32 @@ func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *Instances // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall { +func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall { +func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesUpdateAccessConfigCall) Header() http.Header { +func (c *InstancesStartCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/start") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -35044,12 +34809,12 @@ func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.updateAccessConfig" call. +// Do executes the "compute.instances.start" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35081,30 +34846,29 @@ func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type InstancesUpdateDisplayDeviceCall struct { - s *Service - project string - zone string - instance string - displaydevice *DisplayDevice - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesStartWithEncryptionKeyCall struct { + s *Service + project string + zone string + instance string + instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateDisplayDevice: Updates the Display config for a VM instance. You can -// only use this method on a stopped VM instance. This method supports PATCH -// semantics and uses the JSON merge patch format and processing rules. +// StartWithEncryptionKey: Starts an instance that was stopped using the +// instances().stop method. For more information, see Restart an instance. // -// - instance: Name of the instance scoping this request. +// - instance: Name of the instance resource to start. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall { - c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) StartWithEncryptionKey(project string, zone string, instance string, instancesstartwithencryptionkeyrequest *InstancesStartWithEncryptionKeyRequest) *InstancesStartWithEncryptionKeyCall { + c := &InstancesStartWithEncryptionKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.displaydevice = displaydevice + c.instancesstartwithencryptionkeyrequest = instancesstartwithencryptionkeyrequest return c } @@ -35118,7 +34882,7 @@ func (r *InstancesService) UpdateDisplayDevice(project string, zone string, inst // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall { +func (c *InstancesStartWithEncryptionKeyCall) RequestId(requestId string) *InstancesStartWithEncryptionKeyCall { c.urlParams_.Set("requestId", requestId) return c } @@ -35126,38 +34890,38 @@ func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *Instance // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall { +func (c *InstancesStartWithEncryptionKeyCall) Fields(s ...googleapi.Field) *InstancesStartWithEncryptionKeyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall { +func (c *InstancesStartWithEncryptionKeyCall) Context(ctx context.Context) *InstancesStartWithEncryptionKeyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header { +func (c *InstancesStartWithEncryptionKeyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesStartWithEncryptionKeyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancesstartwithencryptionkeyrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -35170,12 +34934,12 @@ func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.updateDisplayDevice" call. +// Do executes the "compute.instances.startWithEncryptionKey" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesStartWithEncryptionKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35207,34 +34971,40 @@ func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type InstancesUpdateNetworkInterfaceCall struct { - s *Service - project string - zone string - instance string - networkinterface *NetworkInterface - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesStopCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateNetworkInterface: Updates an instance's network interface. This method -// can only update an interface's alias IP range and attached network. See -// Modifying alias IP ranges for an existing instance for instructions on -// changing alias IP ranges. See Migrating a VM between networks for -// instructions on migrating an interface. This method follows PATCH semantics. +// Stop: Stops a running instance, shutting it down cleanly, and allows you to +// restart the instance at a later time. Stopped instances do not incur VM +// usage charges while they are stopped. However, resources that the VM is +// using, such as persistent disks and static IP addresses, will continue to be +// charged until they are deleted. For more information, see Stopping an +// instance. // -// - instance: The instance name for this request. -// - networkInterface: The name of the network interface to update. +// - instance: Name of the instance resource to stop. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall { - c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall { + c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.urlParams_.Set("networkInterface", networkInterface) - c.networkinterface = networkinterface + return c +} + +// DiscardLocalSsd sets the optional parameter "discardLocalSsd": This property +// is required if the instance has any attached Local SSD disks. If false, +// Local SSD data will be preserved when the instance is suspended. If true, +// the contents of any attached Local SSD disks will be discarded. +func (c *InstancesStopCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesStopCall { + c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd)) return c } @@ -35248,7 +35018,7 @@ func (r *InstancesService) UpdateNetworkInterface(project string, zone string, i // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall { +func (c *InstancesStopCall) RequestId(requestId string) *InstancesStopCall { c.urlParams_.Set("requestId", requestId) return c } @@ -35256,38 +35026,34 @@ func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *Insta // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall { +func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall { +func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header { +func (c *InstancesStopCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/stop") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -35300,12 +35066,12 @@ func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.updateNetworkInterface" call. +// Do executes the "compute.instances.stop" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35337,31 +35103,41 @@ func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type InstancesUpdateShieldedInstanceConfigCall struct { - s *Service - project string - zone string - instance string - shieldedinstanceconfig *ShieldedInstanceConfig - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesSuspendCall struct { + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// UpdateShieldedInstanceConfig: Updates the Shielded Instance config for an -// instance. You can only use this method on a stopped instance. This method -// supports PATCH semantics and uses the JSON merge patch format and processing -// rules. +// Suspend: This method suspends a running instance, saving its state to +// persistent storage, and allows you to resume the instance at a later time. +// Suspended instances have no compute costs (cores or RAM), and incur only +// storage charges for the saved VM memory and localSSD data. Any charged +// resources the virtual machine was using, such as persistent disks and static +// IP addresses, will continue to be charged while the instance is suspended. +// For more information, see Suspending and resuming an instance. // -// - instance: Name or id of the instance scoping this request. +// - instance: Name of the instance resource to suspend. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall { - c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Suspend(project string, zone string, instance string) *InstancesSuspendCall { + c := &InstancesSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.shieldedinstanceconfig = shieldedinstanceconfig + return c +} + +// DiscardLocalSsd sets the optional parameter "discardLocalSsd": This property +// is required if the instance has any attached Local SSD disks. If false, +// Local SSD data will be preserved when the instance is suspended. If true, +// the contents of any attached Local SSD disks will be discarded. +func (c *InstancesSuspendCall) DiscardLocalSsd(discardLocalSsd bool) *InstancesSuspendCall { + c.urlParams_.Set("discardLocalSsd", fmt.Sprint(discardLocalSsd)) return c } @@ -35375,7 +35151,7 @@ func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone str // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall { +func (c *InstancesSuspendCall) RequestId(requestId string) *InstancesSuspendCall { c.urlParams_.Set("requestId", requestId) return c } @@ -35383,38 +35159,34 @@ func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall { +func (c *InstancesSuspendCall) Fields(s ...googleapi.Field) *InstancesSuspendCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall { +func (c *InstancesSuspendCall) Context(ctx context.Context) *InstancesSuspendCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header { +func (c *InstancesSuspendCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstancesSuspendCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/suspend") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -35427,12 +35199,12 @@ func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instances.updateShieldedInstanceConfig" call. +// Do executes the "compute.instances.suspend" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesSuspendCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35464,184 +35236,86 @@ func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOpt return ret, nil } -type InstantSnapshotsAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstancesTestIamPermissionsCall struct { + s *Service + project string + zone string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AggregatedList: Retrieves an aggregated list of instantSnapshots. To prevent -// failure, Google recommends that you set the `returnPartialSuccess` parameter -// to `true`. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // // - project: Project ID for this request. -func (r *InstantSnapshotsService) AggregatedList(project string) *InstantSnapshotsAggregatedListCall { - c := &InstantSnapshotsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstancesTestIamPermissionsCall { + c := &InstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InstantSnapshotsAggregatedListCall) Filter(filter string) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *InstantSnapshotsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstantSnapshotsAggregatedListCall) MaxResults(maxResults int64) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstantSnapshotsAggregatedListCall) OrderBy(orderBy string) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *InstantSnapshotsAggregatedListCall) PageToken(pageToken string) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *InstantSnapshotsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *InstantSnapshotsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstantSnapshotsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + c.zone = zone + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsAggregatedListCall) Fields(s ...googleapi.Field) *InstantSnapshotsAggregatedListCall { +func (c *InstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstancesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstantSnapshotsAggregatedListCall) IfNoneMatch(entityTag string) *InstantSnapshotsAggregatedListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsAggregatedListCall) Context(ctx context.Context) *InstantSnapshotsAggregatedListCall { +func (c *InstancesTestIamPermissionsCall) Context(ctx context.Context) *InstancesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsAggregatedListCall) Header() http.Header { +func (c *InstancesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsAggregatedListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instantSnapshots") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.aggregatedList" call. +// Do executes the "compute.instances.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *InstantSnapshotAggregatedList.ServerResponse.Header or (if a response was +// *TestPermissionsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InstantSnapshotsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstantSnapshotAggregatedList, error) { +func (c *InstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35660,7 +35334,7 @@ func (c *InstantSnapshotsAggregatedListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstantSnapshotAggregatedList{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -35673,52 +35347,64 @@ func (c *InstantSnapshotsAggregatedListCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InstantSnapshotsAggregatedListCall) Pages(ctx context.Context, f func(*InstantSnapshotAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type InstantSnapshotsDeleteCall struct { - s *Service - project string - zone string - instantSnapshot string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesUpdateCall struct { + s *Service + project string + zone string + instance string + instance2 *Instance + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified InstantSnapshot resource. Keep in mind that -// deleting a single instantSnapshot might not necessarily delete all the data -// on that instantSnapshot. If any data on the instantSnapshot that is marked -// for deletion is needed for subsequent instantSnapshots, the data will be -// moved to the next corresponding instantSnapshot. For more information, see -// Deleting instantSnapshots. +// Update: Updates an instance only if the necessary resources are available. +// This method can update only a specific set of instance properties. See +// Updating a running instance for a list of updatable instance properties. // -// - instantSnapshot: Name of the InstantSnapshot resource to delete. +// - instance: Name of the instance resource to update. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) Delete(project string, zone string, instantSnapshot string) *InstantSnapshotsDeleteCall { - c := &InstantSnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) Update(project string, zone string, instance string, instance2 *Instance) *InstancesUpdateCall { + c := &InstancesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instantSnapshot = instantSnapshot + c.instance = instance + c.instance2 = instance2 + return c +} + +// MinimalAction sets the optional parameter "minimalAction": Specifies the +// action to take when updating an instance even if the updated properties do +// not require it. If not specified, then Compute Engine acts based on the +// minimum action that the updated properties require. +// +// Possible values: +// +// "INVALID" +// "NO_EFFECT" - No changes can be made to the instance. +// "REFRESH" - The instance will not restart. +// "RESTART" - The instance will restart. +func (c *InstancesUpdateCall) MinimalAction(minimalAction string) *InstancesUpdateCall { + c.urlParams_.Set("minimalAction", minimalAction) + return c +} + +// MostDisruptiveAllowedAction sets the optional parameter +// "mostDisruptiveAllowedAction": Specifies the most disruptive action that can +// be taken on the instance as part of the update. Compute Engine returns an +// error if the instance properties require a more disruptive action as part of +// the instance update. Valid options from lowest to highest are NO_EFFECT, +// REFRESH, and RESTART. +// +// Possible values: +// +// "INVALID" +// "NO_EFFECT" - No changes can be made to the instance. +// "REFRESH" - The instance will not restart. +// "RESTART" - The instance will restart. +func (c *InstancesUpdateCall) MostDisruptiveAllowedAction(mostDisruptiveAllowedAction string) *InstancesUpdateCall { + c.urlParams_.Set("mostDisruptiveAllowedAction", mostDisruptiveAllowedAction) return c } @@ -35732,7 +35418,7 @@ func (r *InstantSnapshotsService) Delete(project string, zone string, instantSna // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstantSnapshotsDeleteCall) RequestId(requestId string) *InstantSnapshotsDeleteCall { +func (c *InstancesUpdateCall) RequestId(requestId string) *InstancesUpdateCall { c.urlParams_.Set("requestId", requestId) return c } @@ -35740,52 +35426,56 @@ func (c *InstantSnapshotsDeleteCall) RequestId(requestId string) *InstantSnapsho // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsDeleteCall) Fields(s ...googleapi.Field) *InstantSnapshotsDeleteCall { +func (c *InstancesUpdateCall) Fields(s ...googleapi.Field) *InstancesUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsDeleteCall) Context(ctx context.Context) *InstantSnapshotsDeleteCall { +func (c *InstancesUpdateCall) Context(ctx context.Context) *InstancesUpdateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsDeleteCall) Header() http.Header { +func (c *InstancesUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstancesUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance2) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instantSnapshot": c.instantSnapshot, + "project": c.project, + "zone": c.zone, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.delete" call. +// Do executes the "compute.instances.update" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstantSnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35817,91 +35507,105 @@ func (c *InstantSnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type InstantSnapshotsGetCall struct { - s *Service - project string - zone string - instantSnapshot string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstancesUpdateAccessConfigCall struct { + s *Service + project string + zone string + instance string + accessconfig *AccessConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified InstantSnapshot resource in the specified zone. +// UpdateAccessConfig: Updates the specified access config from an instance's +// network interface with the data included in the request. This method +// supports PATCH semantics and uses the JSON merge patch format and processing +// rules. // -// - instantSnapshot: Name of the InstantSnapshot resource to return. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) Get(project string, zone string, instantSnapshot string) *InstantSnapshotsGetCall { - c := &InstantSnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instance: The instance name for this request. +// - networkInterface: The name of the network interface where the access +// config is attached. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) UpdateAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesUpdateAccessConfigCall { + c := &InstancesUpdateAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instantSnapshot = instantSnapshot + c.instance = instance + c.urlParams_.Set("networkInterface", networkInterface) + c.accessconfig = accessconfig + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesUpdateAccessConfigCall) RequestId(requestId string) *InstancesUpdateAccessConfigCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsGetCall) Fields(s ...googleapi.Field) *InstantSnapshotsGetCall { +func (c *InstancesUpdateAccessConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateAccessConfigCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstantSnapshotsGetCall) IfNoneMatch(entityTag string) *InstantSnapshotsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsGetCall) Context(ctx context.Context) *InstantSnapshotsGetCall { +func (c *InstancesUpdateAccessConfigCall) Context(ctx context.Context) *InstancesUpdateAccessConfigCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsGetCall) Header() http.Header { +func (c *InstancesUpdateAccessConfigCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstancesUpdateAccessConfigCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "instantSnapshot": c.instantSnapshot, + "project": c.project, + "zone": c.zone, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.get" call. +// Do executes the "compute.instances.updateAccessConfig" call. // Any non-2xx status code is an error. Response headers are in either -// *InstantSnapshot.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstantSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*InstantSnapshot, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesUpdateAccessConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -35920,7 +35624,7 @@ func (c *InstantSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*InstantSnap if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstantSnapshot{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -35933,80 +35637,213 @@ func (c *InstantSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*InstantSnap return ret, nil } -type InstantSnapshotsGetIamPolicyCall struct { - s *Service - project string - zone string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstancesUpdateDisplayDeviceCall struct { + s *Service + project string + zone string + instance string + displaydevice *DisplayDevice + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// UpdateDisplayDevice: Updates the Display config for a VM instance. You can +// only use this method on a stopped VM instance. This method supports PATCH +// semantics and uses the JSON merge patch format and processing rules. // +// - instance: Name of the instance scoping this request. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) GetIamPolicy(project string, zone string, resource string) *InstantSnapshotsGetIamPolicyCall { - c := &InstantSnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstancesService) UpdateDisplayDevice(project string, zone string, instance string, displaydevice *DisplayDevice) *InstancesUpdateDisplayDeviceCall { + c := &InstancesUpdateDisplayDeviceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource + c.instance = instance + c.displaydevice = displaydevice return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *InstantSnapshotsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstantSnapshotsGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesUpdateDisplayDeviceCall) RequestId(requestId string) *InstancesUpdateDisplayDeviceCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *InstantSnapshotsGetIamPolicyCall { +func (c *InstancesUpdateDisplayDeviceCall) Fields(s ...googleapi.Field) *InstancesUpdateDisplayDeviceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InstantSnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *InstantSnapshotsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag +// Context sets the context to be used in this call's Do method. +func (c *InstancesUpdateDisplayDeviceCall) Context(ctx context.Context) *InstancesUpdateDisplayDeviceCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InstancesUpdateDisplayDeviceCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstancesUpdateDisplayDeviceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.displaydevice) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateDisplayDevice") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instance": c.instance, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instances.updateDisplayDevice" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstancesUpdateDisplayDeviceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type InstancesUpdateNetworkInterfaceCall struct { + s *Service + project string + zone string + instance string + networkinterface *NetworkInterface + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// UpdateNetworkInterface: Updates an instance's network interface. This method +// can only update an interface's alias IP range and attached network. See +// Modifying alias IP ranges for an existing instance for instructions on +// changing alias IP ranges. See Migrating a VM between networks for +// instructions on migrating an interface. This method follows PATCH semantics. +// +// - instance: The instance name for this request. +// - networkInterface: The name of the network interface to update. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *InstancesService) UpdateNetworkInterface(project string, zone string, instance string, networkInterface string, networkinterface *NetworkInterface) *InstancesUpdateNetworkInterfaceCall { + c := &InstancesUpdateNetworkInterfaceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instance = instance + c.urlParams_.Set("networkInterface", networkInterface) + c.networkinterface = networkinterface + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstancesUpdateNetworkInterfaceCall) RequestId(requestId string) *InstancesUpdateNetworkInterfaceCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InstancesUpdateNetworkInterfaceCall) Fields(s ...googleapi.Field) *InstancesUpdateNetworkInterfaceCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsGetIamPolicyCall) Context(ctx context.Context) *InstantSnapshotsGetIamPolicyCall { +func (c *InstancesUpdateNetworkInterfaceCall) Context(ctx context.Context) *InstancesUpdateNetworkInterfaceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsGetIamPolicyCall) Header() http.Header { +func (c *InstancesUpdateNetworkInterfaceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstancesUpdateNetworkInterfaceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkinterface) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -36014,17 +35851,17 @@ func (c *InstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, - "resource": c.resource, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.getIamPolicy" call. +// Do executes the "compute.instances.updateNetworkInterface" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstantSnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *InstancesUpdateNetworkInterfaceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36043,7 +35880,7 @@ func (c *InstantSnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Po if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -36056,25 +35893,31 @@ func (c *InstantSnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Po return ret, nil } -type InstantSnapshotsInsertCall struct { - s *Service - project string - zone string - instantsnapshot *InstantSnapshot - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstancesUpdateShieldedInstanceConfigCall struct { + s *Service + project string + zone string + instance string + shieldedinstanceconfig *ShieldedInstanceConfig + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates an instant snapshot in the specified zone. +// UpdateShieldedInstanceConfig: Updates the Shielded Instance config for an +// instance. You can only use this method on a stopped instance. This method +// supports PATCH semantics and uses the JSON merge patch format and processing +// rules. // +// - instance: Name or id of the instance scoping this request. // - project: Project ID for this request. -// - zone: Name of the zone for this request. -func (r *InstantSnapshotsService) Insert(project string, zone string, instantsnapshot *InstantSnapshot) *InstantSnapshotsInsertCall { - c := &InstantSnapshotsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *InstancesService) UpdateShieldedInstanceConfig(project string, zone string, instance string, shieldedinstanceconfig *ShieldedInstanceConfig) *InstancesUpdateShieldedInstanceConfigCall { + c := &InstancesUpdateShieldedInstanceConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.instantsnapshot = instantsnapshot + c.instance = instance + c.shieldedinstanceconfig = shieldedinstanceconfig return c } @@ -36088,7 +35931,7 @@ func (r *InstantSnapshotsService) Insert(project string, zone string, instantsna // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstantSnapshotsInsertCall) RequestId(requestId string) *InstantSnapshotsInsertCall { +func (c *InstancesUpdateShieldedInstanceConfigCall) RequestId(requestId string) *InstancesUpdateShieldedInstanceConfigCall { c.urlParams_.Set("requestId", requestId) return c } @@ -36096,55 +35939,56 @@ func (c *InstantSnapshotsInsertCall) RequestId(requestId string) *InstantSnapsho // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsInsertCall) Fields(s ...googleapi.Field) *InstantSnapshotsInsertCall { +func (c *InstancesUpdateShieldedInstanceConfigCall) Fields(s ...googleapi.Field) *InstancesUpdateShieldedInstanceConfigCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsInsertCall) Context(ctx context.Context) *InstantSnapshotsInsertCall { +func (c *InstancesUpdateShieldedInstanceConfigCall) Context(ctx context.Context) *InstancesUpdateShieldedInstanceConfigCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsInsertCall) Header() http.Header { +func (c *InstancesUpdateShieldedInstanceConfigCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *InstancesUpdateShieldedInstanceConfigCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.shieldedinstanceconfig) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instances/{instance}/updateShieldedInstanceConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "zone": c.zone, + "instance": c.instance, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.insert" call. +// Do executes the "compute.instances.updateShieldedInstanceConfig" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstantSnapshotsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstancesUpdateShieldedInstanceConfigCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36176,25 +36020,23 @@ func (c *InstantSnapshotsInsertCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type InstantSnapshotsListCall struct { +type InstantSnapshotsAggregatedListCall struct { s *Service project string - zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves the list of InstantSnapshot resources contained within the -// specified zone. +// AggregatedList: Retrieves an aggregated list of instantSnapshots. To prevent +// failure, Google recommends that you set the `returnPartialSuccess` parameter +// to `true`. // // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) List(project string, zone string) *InstantSnapshotsListCall { - c := &InstantSnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstantSnapshotsService) AggregatedList(project string) *InstantSnapshotsAggregatedListCall { + c := &InstantSnapshotsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone return c } @@ -36230,17 +36072,30 @@ func (r *InstantSnapshotsService) List(project string, zone string) *InstantSnap // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InstantSnapshotsListCall) Filter(filter string) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) Filter(filter string) *InstantSnapshotsAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *InstantSnapshotsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InstantSnapshotsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InstantSnapshotsListCall) MaxResults(maxResults int64) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) MaxResults(maxResults int64) *InstantSnapshotsAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -36253,7 +36108,7 @@ func (c *InstantSnapshotsListCall) MaxResults(maxResults int64) *InstantSnapshot // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InstantSnapshotsListCall) OrderBy(orderBy string) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) OrderBy(orderBy string) *InstantSnapshotsAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -36261,7 +36116,7 @@ func (c *InstantSnapshotsListCall) OrderBy(orderBy string) *InstantSnapshotsList // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InstantSnapshotsListCall) PageToken(pageToken string) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) PageToken(pageToken string) *InstantSnapshotsAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -36271,15 +36126,23 @@ func (c *InstantSnapshotsListCall) PageToken(pageToken string) *InstantSnapshots // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InstantSnapshotsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstantSnapshotsAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *InstantSnapshotsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InstantSnapshotsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsListCall) Fields(s ...googleapi.Field) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) Fields(s ...googleapi.Field) *InstantSnapshotsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -36287,27 +36150,27 @@ func (c *InstantSnapshotsListCall) Fields(s ...googleapi.Field) *InstantSnapshot // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InstantSnapshotsListCall) IfNoneMatch(entityTag string) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) IfNoneMatch(entityTag string) *InstantSnapshotsAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsListCall) Context(ctx context.Context) *InstantSnapshotsListCall { +func (c *InstantSnapshotsAggregatedListCall) Context(ctx context.Context) *InstantSnapshotsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsListCall) Header() http.Header { +func (c *InstantSnapshotsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) { +func (c *InstantSnapshotsAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -36315,7 +36178,7 @@ func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/instantSnapshots") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -36324,18 +36187,17 @@ func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.list" call. +// Do executes the "compute.instantSnapshots.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *InstantSnapshotList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InstantSnapshotsListCall) Do(opts ...googleapi.CallOption) (*InstantSnapshotList, error) { +// *InstantSnapshotAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstantSnapshotsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InstantSnapshotAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36354,7 +36216,7 @@ func (c *InstantSnapshotsListCall) Do(opts ...googleapi.CallOption) (*InstantSna if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstantSnapshotList{ + ret := &InstantSnapshotAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -36370,7 +36232,7 @@ func (c *InstantSnapshotsListCall) Do(opts ...googleapi.CallOption) (*InstantSna // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InstantSnapshotsListCall) Pages(ctx context.Context, f func(*InstantSnapshotList) error) error { +func (c *InstantSnapshotsAggregatedListCall) Pages(ctx context.Context, f func(*InstantSnapshotAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -36388,85 +36250,98 @@ func (c *InstantSnapshotsListCall) Pages(ctx context.Context, f func(*InstantSna } } -type InstantSnapshotsSetIamPolicyCall struct { - s *Service - project string - zone string - resource string - zonesetpolicyrequest *ZoneSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstantSnapshotsDeleteCall struct { + s *Service + project string + zone string + instantSnapshot string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// Delete: Deletes the specified InstantSnapshot resource. Keep in mind that +// deleting a single instantSnapshot might not necessarily delete all the data +// on that instantSnapshot. If any data on the instantSnapshot that is marked +// for deletion is needed for subsequent instantSnapshots, the data will be +// moved to the next corresponding instantSnapshot. For more information, see +// Deleting instantSnapshots. // +// - instantSnapshot: Name of the InstantSnapshot resource to delete. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstantSnapshotsSetIamPolicyCall { - c := &InstantSnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstantSnapshotsService) Delete(project string, zone string, instantSnapshot string) *InstantSnapshotsDeleteCall { + c := &InstantSnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.zonesetpolicyrequest = zonesetpolicyrequest + c.instantSnapshot = instantSnapshot + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstantSnapshotsDeleteCall) RequestId(requestId string) *InstantSnapshotsDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *InstantSnapshotsSetIamPolicyCall { +func (c *InstantSnapshotsDeleteCall) Fields(s ...googleapi.Field) *InstantSnapshotsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsSetIamPolicyCall) Context(ctx context.Context) *InstantSnapshotsSetIamPolicyCall { +func (c *InstantSnapshotsDeleteCall) Context(ctx context.Context) *InstantSnapshotsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsSetIamPolicyCall) Header() http.Header { +func (c *InstantSnapshotsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InstantSnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "zone": c.zone, + "instantSnapshot": c.instantSnapshot, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.setIamPolicy" call. +// Do executes the "compute.instantSnapshots.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InstantSnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *InstantSnapshotsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36485,7 +36360,7 @@ func (c *InstantSnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Po if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -36498,100 +36373,91 @@ func (c *InstantSnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Po return ret, nil } -type InstantSnapshotsSetLabelsCall struct { - s *Service - project string - zone string - resource string - zonesetlabelsrequest *ZoneSetLabelsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstantSnapshotsGetCall struct { + s *Service + project string + zone string + instantSnapshot string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetLabels: Sets the labels on a instantSnapshot in the given zone. To learn -// more about labels, read the Labeling Resources documentation. +// Get: Returns the specified InstantSnapshot resource in the specified zone. // +// - instantSnapshot: Name of the InstantSnapshot resource to return. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *InstantSnapshotsSetLabelsCall { - c := &InstantSnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstantSnapshotsService) Get(project string, zone string, instantSnapshot string) *InstantSnapshotsGetCall { + c := &InstantSnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.zonesetlabelsrequest = zonesetlabelsrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InstantSnapshotsSetLabelsCall) RequestId(requestId string) *InstantSnapshotsSetLabelsCall { - c.urlParams_.Set("requestId", requestId) + c.instantSnapshot = instantSnapshot return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *InstantSnapshotsSetLabelsCall { +func (c *InstantSnapshotsGetCall) Fields(s ...googleapi.Field) *InstantSnapshotsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstantSnapshotsGetCall) IfNoneMatch(entityTag string) *InstantSnapshotsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsSetLabelsCall) Context(ctx context.Context) *InstantSnapshotsSetLabelsCall { +func (c *InstantSnapshotsGetCall) Context(ctx context.Context) *InstantSnapshotsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsSetLabelsCall) Header() http.Header { +func (c *InstantSnapshotsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) - if err != nil { - return nil, err +func (c *InstantSnapshotsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setLabels") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{instantSnapshot}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "zone": c.zone, + "instantSnapshot": c.instantSnapshot, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.setLabels" call. +// Do executes the "compute.instantSnapshots.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InstantSnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *InstantSnapshot.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstantSnapshotsGetCall) Do(opts ...googleapi.CallOption) (*InstantSnapshot, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36610,7 +36476,7 @@ func (c *InstantSnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Opera if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &InstantSnapshot{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -36623,65 +36489,199 @@ func (c *InstantSnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Opera return ret, nil } -type InstantSnapshotsTestIamPermissionsCall struct { - s *Service - project string - zone string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstantSnapshotsGetIamPolicyCall struct { + s *Service + project string + zone string + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // // - project: Project ID for this request. // - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *InstantSnapshotsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstantSnapshotsTestIamPermissionsCall { - c := &InstantSnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InstantSnapshotsService) GetIamPolicy(project string, zone string, resource string) *InstantSnapshotsGetIamPolicyCall { + c := &InstantSnapshotsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *InstantSnapshotsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *InstantSnapshotsGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InstantSnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstantSnapshotsTestIamPermissionsCall { +func (c *InstantSnapshotsGetIamPolicyCall) Fields(s ...googleapi.Field) *InstantSnapshotsGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// Context sets the context to be used in this call's Do method. -func (c *InstantSnapshotsTestIamPermissionsCall) Context(ctx context.Context) *InstantSnapshotsTestIamPermissionsCall { - c.ctx_ = ctx +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InstantSnapshotsGetIamPolicyCall) IfNoneMatch(entityTag string) *InstantSnapshotsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InstantSnapshotsGetIamPolicyCall) Context(ctx context.Context) *InstantSnapshotsGetIamPolicyCall { + c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InstantSnapshotsTestIamPermissionsCall) Header() http.Header { +func (c *InstantSnapshotsGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *InstantSnapshotsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/getIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.instantSnapshots.getIamPolicy" call. +// Any non-2xx status code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstantSnapshotsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type InstantSnapshotsInsertCall struct { + s *Service + project string + zone string + instantsnapshot *InstantSnapshot + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates an instant snapshot in the specified zone. +// +// - project: Project ID for this request. +// - zone: Name of the zone for this request. +func (r *InstantSnapshotsService) Insert(project string, zone string, instantsnapshot *InstantSnapshot) *InstantSnapshotsInsertCall { + c := &InstantSnapshotsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instantsnapshot = instantsnapshot + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstantSnapshotsInsertCall) RequestId(requestId string) *InstantSnapshotsInsertCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InstantSnapshotsInsertCall) Fields(s ...googleapi.Field) *InstantSnapshotsInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InstantSnapshotsInsertCall) Context(ctx context.Context) *InstantSnapshotsInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InstantSnapshotsInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *InstantSnapshotsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantsnapshot) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -36689,20 +36689,18 @@ func (c *InstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Re } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.instantSnapshots.testIamPermissions" call. +// Do executes the "compute.instantSnapshots.insert" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InstantSnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstantSnapshotsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36721,7 +36719,7 @@ func (c *InstantSnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -36734,23 +36732,25 @@ func (c *InstantSnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption return ret, nil } -type InterconnectAttachmentsAggregatedListCall struct { +type InstantSnapshotsListCall struct { s *Service project string + zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves an aggregated list of interconnect attachments. To -// prevent failure, Google recommends that you set the `returnPartialSuccess` -// parameter to `true`. +// List: Retrieves the list of InstantSnapshot resources contained within the +// specified zone. // // - project: Project ID for this request. -func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall { - c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *InstantSnapshotsService) List(project string, zone string) *InstantSnapshotsListCall { + c := &InstantSnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.zone = zone return c } @@ -36786,30 +36786,17 @@ func (r *InterconnectAttachmentsService) AggregatedList(project string) *Interco // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) Filter(filter string) *InstantSnapshotsListCall { c.urlParams_.Set("filter", filter) return c } -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *InterconnectAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InterconnectAttachmentsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) MaxResults(maxResults int64) *InstantSnapshotsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -36822,7 +36809,7 @@ func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) OrderBy(orderBy string) *InstantSnapshotsListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -36830,7 +36817,7 @@ func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *Int // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) PageToken(pageToken string) *InstantSnapshotsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -36840,23 +36827,15 @@ func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InterconnectAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InstantSnapshotsListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *InterconnectAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InterconnectAttachmentsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) Fields(s ...googleapi.Field) *InstantSnapshotsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -36864,27 +36843,27 @@ func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) IfNoneMatch(entityTag string) *InstantSnapshotsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall { +func (c *InstantSnapshotsListCall) Context(ctx context.Context) *InstantSnapshotsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header { +func (c *InstantSnapshotsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *InstantSnapshotsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -36892,7 +36871,7 @@ func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/interconnectAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -36901,17 +36880,18 @@ func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.aggregatedList" call. +// Do executes the "compute.instantSnapshots.list" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectAttachmentAggregatedList.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) { +// *InstantSnapshotList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstantSnapshotsListCall) Do(opts ...googleapi.CallOption) (*InstantSnapshotList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -36930,7 +36910,7 @@ func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectAttachmentAggregatedList{ + ret := &InstantSnapshotList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -36946,7 +36926,7 @@ func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOpt // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error { +func (c *InstantSnapshotsListCall) Pages(ctx context.Context, f func(*InstantSnapshotList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -36964,93 +36944,85 @@ func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f } } -type InterconnectAttachmentsDeleteCall struct { - s *Service - project string - region string - interconnectAttachment string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InstantSnapshotsSetIamPolicyCall struct { + s *Service + project string + zone string + resource string + zonesetpolicyrequest *ZoneSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified interconnect attachment. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - interconnectAttachment: Name of the interconnect attachment to delete. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall { - c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *InstantSnapshotsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *InstantSnapshotsSetIamPolicyCall { + c := &InstantSnapshotsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.interconnectAttachment = interconnectAttachment - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall { - c.urlParams_.Set("requestId", requestId) + c.zone = zone + c.resource = resource + c.zonesetpolicyrequest = zonesetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall { +func (c *InstantSnapshotsSetIamPolicyCall) Fields(s ...googleapi.Field) *InstantSnapshotsSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall { +func (c *InstantSnapshotsSetIamPolicyCall) Context(ctx context.Context) *InstantSnapshotsSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsDeleteCall) Header() http.Header { +func (c *InstantSnapshotsSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InstantSnapshotsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "interconnectAttachment": c.interconnectAttachment, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.delete" call. +// Do executes the "compute.instantSnapshots.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InstantSnapshotsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37069,7 +37041,7 @@ func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -37082,91 +37054,100 @@ func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type InterconnectAttachmentsGetCall struct { - s *Service - project string - region string - interconnectAttachment string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InstantSnapshotsSetLabelsCall struct { + s *Service + project string + zone string + resource string + zonesetlabelsrequest *ZoneSetLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified interconnect attachment. +// SetLabels: Sets the labels on a instantSnapshot in the given zone. To learn +// more about labels, read the Labeling Resources documentation. // -// - interconnectAttachment: Name of the interconnect attachment to return. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall { - c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *InstantSnapshotsService) SetLabels(project string, zone string, resource string, zonesetlabelsrequest *ZoneSetLabelsRequest) *InstantSnapshotsSetLabelsCall { + c := &InstantSnapshotsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.interconnectAttachment = interconnectAttachment + c.zone = zone + c.resource = resource + c.zonesetlabelsrequest = zonesetlabelsrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InstantSnapshotsSetLabelsCall) RequestId(requestId string) *InstantSnapshotsSetLabelsCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall { +func (c *InstantSnapshotsSetLabelsCall) Fields(s ...googleapi.Field) *InstantSnapshotsSetLabelsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall { +func (c *InstantSnapshotsSetLabelsCall) Context(ctx context.Context) *InstantSnapshotsSetLabelsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsGetCall) Header() http.Header { +func (c *InstantSnapshotsSetLabelsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InstantSnapshotsSetLabelsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetlabelsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/setLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "interconnectAttachment": c.interconnectAttachment, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.get" call. +// Do executes the "compute.instantSnapshots.setLabels" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectAttachment.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InstantSnapshotsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37185,7 +37166,7 @@ func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*Inte if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectAttachment{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -37198,84 +37179,65 @@ func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*Inte return ret, nil } -type InterconnectAttachmentsInsertCall struct { +type InstantSnapshotsTestIamPermissionsCall struct { s *Service project string - region string - interconnectattachment *InterconnectAttachment + zone string + resource string + testpermissionsrequest *TestPermissionsRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Insert: Creates an InterconnectAttachment in the specified project using the -// data included in the request. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall { - c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *InstantSnapshotsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *InstantSnapshotsTestIamPermissionsCall { + c := &InstantSnapshotsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.interconnectattachment = interconnectattachment - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// ValidateOnly sets the optional parameter "validateOnly": If true, the -// request will not be committed. -func (c *InterconnectAttachmentsInsertCall) ValidateOnly(validateOnly bool) *InterconnectAttachmentsInsertCall { - c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + c.zone = zone + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall { +func (c *InstantSnapshotsTestIamPermissionsCall) Fields(s ...googleapi.Field) *InstantSnapshotsTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall { +func (c *InstantSnapshotsTestIamPermissionsCall) Context(ctx context.Context) *InstantSnapshotsTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsInsertCall) Header() http.Header { +func (c *InstantSnapshotsTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *InstantSnapshotsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/instantSnapshots/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -37283,18 +37245,20 @@ func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Respons } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.insert" call. +// Do executes the "compute.instantSnapshots.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InstantSnapshotsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37313,7 +37277,7 @@ func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -37326,25 +37290,23 @@ func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type InterconnectAttachmentsListCall struct { +type InterconnectAttachmentsAggregatedListCall struct { s *Service project string - region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves the list of interconnect attachments contained within the -// specified region. +// AggregatedList: Retrieves an aggregated list of interconnect attachments. To +// prevent failure, Google recommends that you set the `returnPartialSuccess` +// parameter to `true`. // // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall { - c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectAttachmentsService) AggregatedList(project string) *InterconnectAttachmentsAggregatedListCall { + c := &InterconnectAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region return c } @@ -37380,17 +37342,30 @@ func (r *InterconnectAttachmentsService) List(project string, region string) *In // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) Filter(filter string) *InterconnectAttachmentsAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *InterconnectAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *InterconnectAttachmentsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) MaxResults(maxResults int64) *InterconnectAttachmentsAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -37403,7 +37378,7 @@ func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *Intercon // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) OrderBy(orderBy string) *InterconnectAttachmentsAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -37411,7 +37386,7 @@ func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectA // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) PageToken(pageToken string) *InterconnectAttachmentsAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -37421,15 +37396,23 @@ func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *Interconn // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InterconnectAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectAttachmentsAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *InterconnectAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *InterconnectAttachmentsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -37437,27 +37420,27 @@ func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *Intercon // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall { +func (c *InterconnectAttachmentsAggregatedListCall) Context(ctx context.Context) *InterconnectAttachmentsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsListCall) Header() http.Header { +func (c *InterconnectAttachmentsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -37465,7 +37448,7 @@ func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/interconnectAttachments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -37474,18 +37457,17 @@ func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.list" call. +// Do executes the "compute.interconnectAttachments.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectAttachmentList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *InterconnectAttachmentAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) { +func (c *InterconnectAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37504,7 +37486,7 @@ func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*Int if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectAttachmentList{ + ret := &InterconnectAttachmentAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -37520,7 +37502,7 @@ func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*Int // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error { +func (c *InterconnectAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -37538,30 +37520,26 @@ func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*Int } } -type InterconnectAttachmentsPatchCall struct { +type InterconnectAttachmentsDeleteCall struct { s *Service project string region string interconnectAttachment string - interconnectattachment *InterconnectAttachment urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Updates the specified interconnect attachment with the data included -// in the request. This method supports PATCH semantics and uses the JSON merge -// patch format and processing rules. +// Delete: Deletes the specified interconnect attachment. // -// - interconnectAttachment: Name of the interconnect attachment to patch. +// - interconnectAttachment: Name of the interconnect attachment to delete. // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall { - c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *InterconnectAttachmentsService) Delete(project string, region string, interconnectAttachment string) *InterconnectAttachmentsDeleteCall { + c := &InterconnectAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.interconnectAttachment = interconnectAttachment - c.interconnectattachment = interconnectattachment return c } @@ -37575,7 +37553,7 @@ func (r *InterconnectAttachmentsService) Patch(project string, region string, in // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall { +func (c *InterconnectAttachmentsDeleteCall) RequestId(requestId string) *InterconnectAttachmentsDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -37583,38 +37561,34 @@ func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *Intercon // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall { +func (c *InterconnectAttachmentsDeleteCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall { +func (c *InterconnectAttachmentsDeleteCall) Context(ctx context.Context) *InterconnectAttachmentsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsPatchCall) Header() http.Header { +func (c *InterconnectAttachmentsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InterconnectAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -37627,12 +37601,12 @@ func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.patch" call. +// Do executes the "compute.interconnectAttachments.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InterconnectAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37664,100 +37638,91 @@ func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type InterconnectAttachmentsSetLabelsCall struct { +type InterconnectAttachmentsGetCall struct { s *Service project string region string - resource string - regionsetlabelsrequest *RegionSetLabelsRequest + interconnectAttachment string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// SetLabels: Sets the labels on an InterconnectAttachment. To learn more about -// labels, read the Labeling Resources documentation. +// Get: Returns the specified interconnect attachment. // +// - interconnectAttachment: Name of the interconnect attachment to return. // - project: Project ID for this request. -// - region: The region for this request. -// - resource: Name or id of the resource for this request. -func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall { - c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *InterconnectAttachmentsService) Get(project string, region string, interconnectAttachment string) *InterconnectAttachmentsGetCall { + c := &InterconnectAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.regionsetlabelsrequest = regionsetlabelsrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall { - c.urlParams_.Set("requestId", requestId) + c.interconnectAttachment = interconnectAttachment return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall { +func (c *InterconnectAttachmentsGetCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InterconnectAttachmentsGetCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall { +func (c *InterconnectAttachmentsGetCall) Context(ctx context.Context) *InterconnectAttachmentsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header { +func (c *InterconnectAttachmentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) - if err != nil { - return nil, err +func (c *InterconnectAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "interconnectAttachment": c.interconnectAttachment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectAttachments.setLabels" call. +// Do executes the "compute.interconnectAttachments.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *InterconnectAttachment.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InterconnectAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37776,7 +37741,7 @@ func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &InterconnectAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -37789,88 +37754,103 @@ func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) return ret, nil } -type InterconnectLocationsGetCall struct { - s *Service - project string - interconnectLocation string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InterconnectAttachmentsInsertCall struct { + s *Service + project string + region string + interconnectattachment *InterconnectAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the details for the specified interconnect location. Gets a -// list of available interconnect locations by making a list() request. +// Insert: Creates an InterconnectAttachment in the specified project using the +// data included in the request. // -// - interconnectLocation: Name of the interconnect location to return. // - project: Project ID for this request. -func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall { - c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *InterconnectAttachmentsService) Insert(project string, region string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsInsertCall { + c := &InterconnectAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.interconnectLocation = interconnectLocation + c.region = region + c.interconnectattachment = interconnectattachment + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InterconnectAttachmentsInsertCall) RequestId(requestId string) *InterconnectAttachmentsInsertCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// ValidateOnly sets the optional parameter "validateOnly": If true, the +// request will not be committed. +func (c *InterconnectAttachmentsInsertCall) ValidateOnly(validateOnly bool) *InterconnectAttachmentsInsertCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall { +func (c *InterconnectAttachmentsInsertCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall { +func (c *InterconnectAttachmentsInsertCall) Context(ctx context.Context) *InterconnectAttachmentsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectLocationsGetCall) Header() http.Header { +func (c *InterconnectAttachmentsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InterconnectAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations/{interconnectLocation}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "interconnectLocation": c.interconnectLocation, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectLocations.get" call. +// Do executes the "compute.interconnectAttachments.insert" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectLocation.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InterconnectAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -37889,7 +37869,7 @@ func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*Interc if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectLocation{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -37902,22 +37882,25 @@ func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*Interc return ret, nil } -type InterconnectLocationsListCall struct { +type InterconnectAttachmentsListCall struct { s *Service project string + region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves the list of interconnect locations available to the -// specified project. +// List: Retrieves the list of interconnect attachments contained within the +// specified region. // // - project: Project ID for this request. -func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall { - c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *InterconnectAttachmentsService) List(project string, region string) *InterconnectAttachmentsListCall { + c := &InterconnectAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region return c } @@ -37953,7 +37936,7 @@ func (r *InterconnectLocationsService) List(project string) *InterconnectLocatio // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) Filter(filter string) *InterconnectAttachmentsListCall { c.urlParams_.Set("filter", filter) return c } @@ -37963,7 +37946,7 @@ func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocat // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) MaxResults(maxResults int64) *InterconnectAttachmentsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -37976,7 +37959,7 @@ func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *Interconne // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) OrderBy(orderBy string) *InterconnectAttachmentsListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -37984,7 +37967,7 @@ func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLoc // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) PageToken(pageToken string) *InterconnectAttachmentsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -37994,7 +37977,7 @@ func (c *InterconnectLocationsListCall) PageToken(pageToken string) *Interconnec // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InterconnectLocationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectAttachmentsListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -38002,7 +37985,7 @@ func (c *InterconnectLocationsListCall) ReturnPartialSuccess(returnPartialSucces // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -38010,27 +37993,27 @@ func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *Interconne // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) IfNoneMatch(entityTag string) *InterconnectAttachmentsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall { +func (c *InterconnectAttachmentsListCall) Context(ctx context.Context) *InterconnectAttachmentsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectLocationsListCall) Header() http.Header { +func (c *InterconnectAttachmentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectAttachmentsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -38038,7 +38021,7 @@ func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, e var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -38047,17 +38030,18 @@ func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, e req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectLocations.list" call. +// Do executes the "compute.interconnectAttachments.list" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectLocationList.ServerResponse.Header or (if a response was +// *InterconnectAttachmentList.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) { +func (c *InterconnectAttachmentsListCall) Do(opts ...googleapi.CallOption) (*InterconnectAttachmentList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -38076,7 +38060,7 @@ func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*Inter if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectLocationList{ + ret := &InterconnectAttachmentList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -38092,7 +38076,7 @@ func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*Inter // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error { +func (c *InterconnectAttachmentsListCall) Pages(ctx context.Context, f func(*InterconnectAttachmentList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -38110,90 +38094,101 @@ func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*Inter } } -type InterconnectRemoteLocationsGetCall struct { - s *Service - project string - interconnectRemoteLocation string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InterconnectAttachmentsPatchCall struct { + s *Service + project string + region string + interconnectAttachment string + interconnectattachment *InterconnectAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the details for the specified interconnect remote location. -// Gets a list of available interconnect remote locations by making a list() -// request. +// Patch: Updates the specified interconnect attachment with the data included +// in the request. This method supports PATCH semantics and uses the JSON merge +// patch format and processing rules. // -// - interconnectRemoteLocation: Name of the interconnect remote location to -// return. -// - project: Project ID for this request. -func (r *InterconnectRemoteLocationsService) Get(project string, interconnectRemoteLocation string) *InterconnectRemoteLocationsGetCall { - c := &InterconnectRemoteLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - interconnectAttachment: Name of the interconnect attachment to patch. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *InterconnectAttachmentsService) Patch(project string, region string, interconnectAttachment string, interconnectattachment *InterconnectAttachment) *InterconnectAttachmentsPatchCall { + c := &InterconnectAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.interconnectRemoteLocation = interconnectRemoteLocation + c.region = region + c.interconnectAttachment = interconnectAttachment + c.interconnectattachment = interconnectattachment + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InterconnectAttachmentsPatchCall) RequestId(requestId string) *InterconnectAttachmentsPatchCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectRemoteLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectRemoteLocationsGetCall { +func (c *InterconnectAttachmentsPatchCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InterconnectRemoteLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectRemoteLocationsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *InterconnectRemoteLocationsGetCall) Context(ctx context.Context) *InterconnectRemoteLocationsGetCall { +func (c *InterconnectAttachmentsPatchCall) Context(ctx context.Context) *InterconnectAttachmentsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectRemoteLocationsGetCall) Header() http.Header { +func (c *InterconnectAttachmentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectRemoteLocationsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InterconnectAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnectattachment) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "interconnectRemoteLocation": c.interconnectRemoteLocation, + "project": c.project, + "region": c.region, + "interconnectAttachment": c.interconnectAttachment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnectRemoteLocations.get" call. +// Do executes the "compute.interconnectAttachments.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectRemoteLocation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InterconnectRemoteLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectRemoteLocation, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InterconnectAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -38212,7 +38207,7 @@ func (c *InterconnectRemoteLocationsGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectRemoteLocation{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -38225,297 +38220,100 @@ func (c *InterconnectRemoteLocationsGetCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type InterconnectRemoteLocationsListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InterconnectAttachmentsSetLabelsCall struct { + s *Service + project string + region string + resource string + regionsetlabelsrequest *RegionSetLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Retrieves the list of interconnect remote locations available to the -// specified project. +// SetLabels: Sets the labels on an InterconnectAttachment. To learn more about +// labels, read the Labeling Resources documentation. // // - project: Project ID for this request. -func (r *InterconnectRemoteLocationsService) List(project string) *InterconnectRemoteLocationsListCall { - c := &InterconnectRemoteLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The region for this request. +// - resource: Name or id of the resource for this request. +func (r *InterconnectAttachmentsService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *InterconnectAttachmentsSetLabelsCall { + c := &InterconnectAttachmentsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region + c.resource = resource + c.regionsetlabelsrequest = regionsetlabelsrequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InterconnectRemoteLocationsListCall) Filter(filter string) *InterconnectRemoteLocationsListCall { - c.urlParams_.Set("filter", filter) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *InterconnectAttachmentsSetLabelsCall) RequestId(requestId string) *InterconnectAttachmentsSetLabelsCall { + c.urlParams_.Set("requestId", requestId) return c } -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InterconnectRemoteLocationsListCall) MaxResults(maxResults int64) *InterconnectRemoteLocationsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *InterconnectAttachmentsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectAttachmentsSetLabelsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *InterconnectRemoteLocationsListCall) OrderBy(orderBy string) *InterconnectRemoteLocationsListCall { - c.urlParams_.Set("orderBy", orderBy) +// Context sets the context to be used in this call's Do method. +func (c *InterconnectAttachmentsSetLabelsCall) Context(ctx context.Context) *InterconnectAttachmentsSetLabelsCall { + c.ctx_ = ctx return c } -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *InterconnectRemoteLocationsListCall) PageToken(pageToken string) *InterconnectRemoteLocationsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *InterconnectAttachmentsSetLabelsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *InterconnectRemoteLocationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectRemoteLocationsListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *InterconnectRemoteLocationsListCall) Fields(s ...googleapi.Field) *InterconnectRemoteLocationsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *InterconnectRemoteLocationsListCall) IfNoneMatch(entityTag string) *InterconnectRemoteLocationsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *InterconnectRemoteLocationsListCall) Context(ctx context.Context) *InterconnectRemoteLocationsListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *InterconnectRemoteLocationsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *InterconnectRemoteLocationsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InterconnectAttachmentsSetLabelsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.interconnectRemoteLocations.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *InterconnectRemoteLocationList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *InterconnectRemoteLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectRemoteLocationList, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) if err != nil { return nil, err } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &InterconnectRemoteLocationList{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *InterconnectRemoteLocationsListCall) Pages(ctx context.Context, f func(*InterconnectRemoteLocationList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type InterconnectsDeleteCall struct { - s *Service - project string - interconnect string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Delete: Deletes the specified Interconnect. -// -// - interconnect: Name of the interconnect to delete. -// - project: Project ID for this request. -func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall { - c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.interconnect = interconnect - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *InterconnectsDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "interconnect": c.interconnect, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.delete" call. +// Do executes the "compute.interconnectAttachments.setLabels" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InterconnectAttachmentsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -38547,32 +38345,32 @@ func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type InterconnectsGetCall struct { - s *Service - project string - interconnect string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InterconnectLocationsGetCall struct { + s *Service + project string + interconnectLocation string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified Interconnect. Get a list of available -// Interconnects by making a list() request. +// Get: Returns the details for the specified interconnect location. Gets a +// list of available interconnect locations by making a list() request. // -// - interconnect: Name of the interconnect to return. +// - interconnectLocation: Name of the interconnect location to return. // - project: Project ID for this request. -func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall { - c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectLocationsService) Get(project string, interconnectLocation string) *InterconnectLocationsGetCall { + c := &InterconnectLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.interconnect = interconnect + c.interconnectLocation = interconnectLocation return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall { +func (c *InterconnectLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -38580,27 +38378,27 @@ func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCal // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall { +func (c *InterconnectLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectLocationsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall { +func (c *InterconnectLocationsGetCall) Context(ctx context.Context) *InterconnectLocationsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectsGetCall) Header() http.Header { +func (c *InterconnectLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -38608,7 +38406,7 @@ func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations/{interconnectLocation}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -38616,18 +38414,19 @@ func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "interconnect": c.interconnect, + "project": c.project, + "interconnectLocation": c.interconnectLocation, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.get" call. +// Do executes the "compute.interconnectLocations.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Interconnect.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) { +// *InterconnectLocation.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InterconnectLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectLocation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -38646,7 +38445,7 @@ func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Interconnect{ + ret := &InterconnectLocation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -38659,35 +38458,107 @@ func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, return ret, nil } -type InterconnectsGetDiagnosticsCall struct { +type InterconnectLocationsListCall struct { s *Service project string - interconnect string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetDiagnostics: Returns the interconnectDiagnostics for the specified -// Interconnect. In the event of a global outage, do not use this API to make -// decisions about where to redirect your network traffic. Unlike a VLAN -// attachment, which is regional, a Cloud Interconnect connection is a global -// resource. A global outage can prevent this API from functioning properly. +// List: Retrieves the list of interconnect locations available to the +// specified project. // -// - interconnect: Name of the interconnect resource to query. // - project: Project ID for this request. -func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall { - c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectLocationsService) List(project string) *InterconnectLocationsListCall { + c := &InterconnectLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.interconnect = interconnect + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InterconnectLocationsListCall) Filter(filter string) *InterconnectLocationsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InterconnectLocationsListCall) MaxResults(maxResults int64) *InterconnectLocationsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *InterconnectLocationsListCall) OrderBy(orderBy string) *InterconnectLocationsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *InterconnectLocationsListCall) PageToken(pageToken string) *InterconnectLocationsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *InterconnectLocationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectLocationsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall { +func (c *InterconnectLocationsListCall) Fields(s ...googleapi.Field) *InterconnectLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -38695,27 +38566,27 @@ func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *Intercon // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall { +func (c *InterconnectLocationsListCall) IfNoneMatch(entityTag string) *InterconnectLocationsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall { +func (c *InterconnectLocationsListCall) Context(ctx context.Context) *InterconnectLocationsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectsGetDiagnosticsCall) Header() http.Header { +func (c *InterconnectLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -38723,7 +38594,7 @@ func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getDiagnostics") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectLocations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -38731,19 +38602,18 @@ func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "interconnect": c.interconnect, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.getDiagnostics" call. +// Do executes the "compute.interconnectLocations.list" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *InterconnectLocationList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) { +func (c *InterconnectLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectLocationList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -38762,7 +38632,7 @@ func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*Int if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectsGetDiagnosticsResponse{ + ret := &InterconnectLocationList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -38775,32 +38645,55 @@ func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*Int return ret, nil } -type InterconnectsGetMacsecConfigCall struct { - s *Service - project string - interconnect string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *InterconnectLocationsListCall) Pages(ctx context.Context, f func(*InterconnectLocationList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// GetMacsecConfig: Returns the interconnectMacsecConfig for the specified -// Interconnect. +type InterconnectRemoteLocationsGetCall struct { + s *Service + project string + interconnectRemoteLocation string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the details for the specified interconnect remote location. +// Gets a list of available interconnect remote locations by making a list() +// request. // -// - interconnect: Name of the interconnect resource to query. -// - project: Project ID for this request. -func (r *InterconnectsService) GetMacsecConfig(project string, interconnect string) *InterconnectsGetMacsecConfigCall { - c := &InterconnectsGetMacsecConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - interconnectRemoteLocation: Name of the interconnect remote location to +// return. +// - project: Project ID for this request. +func (r *InterconnectRemoteLocationsService) Get(project string, interconnectRemoteLocation string) *InterconnectRemoteLocationsGetCall { + c := &InterconnectRemoteLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.interconnect = interconnect + c.interconnectRemoteLocation = interconnectRemoteLocation return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectsGetMacsecConfigCall) Fields(s ...googleapi.Field) *InterconnectsGetMacsecConfigCall { +func (c *InterconnectRemoteLocationsGetCall) Fields(s ...googleapi.Field) *InterconnectRemoteLocationsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -38808,27 +38701,27 @@ func (c *InterconnectsGetMacsecConfigCall) Fields(s ...googleapi.Field) *Interco // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectsGetMacsecConfigCall) IfNoneMatch(entityTag string) *InterconnectsGetMacsecConfigCall { +func (c *InterconnectRemoteLocationsGetCall) IfNoneMatch(entityTag string) *InterconnectRemoteLocationsGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectsGetMacsecConfigCall) Context(ctx context.Context) *InterconnectsGetMacsecConfigCall { +func (c *InterconnectRemoteLocationsGetCall) Context(ctx context.Context) *InterconnectRemoteLocationsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectsGetMacsecConfigCall) Header() http.Header { +func (c *InterconnectRemoteLocationsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectRemoteLocationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -38836,7 +38729,7 @@ func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations/{interconnectRemoteLocation}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -38844,19 +38737,19 @@ func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "interconnect": c.interconnect, + "project": c.project, + "interconnectRemoteLocation": c.interconnectRemoteLocation, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.getMacsecConfig" call. +// Do executes the "compute.interconnectRemoteLocations.get" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectsGetMacsecConfigResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use +// *InterconnectRemoteLocation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *InterconnectsGetMacsecConfigCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetMacsecConfigResponse, error) { +func (c *InterconnectRemoteLocationsGetCall) Do(opts ...googleapi.CallOption) (*InterconnectRemoteLocation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -38875,7 +38768,7 @@ func (c *InterconnectsGetMacsecConfigCall) Do(opts ...googleapi.CallOption) (*In if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectsGetMacsecConfigResponse{ + ret := &InterconnectRemoteLocation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -38888,176 +38781,59 @@ func (c *InterconnectsGetMacsecConfigCall) Do(opts ...googleapi.CallOption) (*In return ret, nil } -type InterconnectsInsertCall struct { +type InterconnectRemoteLocationsListCall struct { s *Service project string - interconnect *Interconnect urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Insert: Creates an Interconnect in the specified project using the data -// included in the request. +// List: Retrieves the list of interconnect remote locations available to the +// specified project. // // - project: Project ID for this request. -func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall { - c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectRemoteLocationsService) List(project string) *InterconnectRemoteLocationsListCall { + c := &InterconnectRemoteLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.interconnect = interconnect return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *InterconnectsInsertCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.interconnects.insert" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type InterconnectsListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// List: Retrieves the list of Interconnects available to the specified -// project. -// -// - project: Project ID for this request. -func (r *InterconnectsService) List(project string) *InterconnectsListCall { - c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall { - c.urlParams_.Set("filter", filter) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InterconnectRemoteLocationsListCall) Filter(filter string) *InterconnectRemoteLocationsListCall { + c.urlParams_.Set("filter", filter) return c } @@ -39066,7 +38842,7 @@ func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall { // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) MaxResults(maxResults int64) *InterconnectRemoteLocationsListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -39079,7 +38855,7 @@ func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListC // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) OrderBy(orderBy string) *InterconnectRemoteLocationsListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -39087,7 +38863,7 @@ func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall { // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) PageToken(pageToken string) *InterconnectRemoteLocationsListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -39097,7 +38873,7 @@ func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCa // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *InterconnectsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectRemoteLocationsListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -39105,7 +38881,7 @@ func (c *InterconnectsListCall) ReturnPartialSuccess(returnPartialSuccess bool) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) Fields(s ...googleapi.Field) *InterconnectRemoteLocationsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -39113,27 +38889,27 @@ func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListC // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) IfNoneMatch(entityTag string) *InterconnectRemoteLocationsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall { +func (c *InterconnectRemoteLocationsListCall) Context(ctx context.Context) *InterconnectRemoteLocationsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectsListCall) Header() http.Header { +func (c *InterconnectRemoteLocationsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectRemoteLocationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -39141,7 +38917,7 @@ func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnectRemoteLocations") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -39154,13 +38930,13 @@ func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.list" call. +// Do executes the "compute.interconnectRemoteLocations.list" call. // Any non-2xx status code is an error. Response headers are in either -// *InterconnectList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) { +// *InterconnectRemoteLocationList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InterconnectRemoteLocationsListCall) Do(opts ...googleapi.CallOption) (*InterconnectRemoteLocationList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39179,7 +38955,7 @@ func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectL if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InterconnectList{ + ret := &InterconnectRemoteLocationList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -39195,7 +38971,7 @@ func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectL // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error { +func (c *InterconnectRemoteLocationsListCall) Pages(ctx context.Context, f func(*InterconnectRemoteLocationList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -39213,27 +38989,23 @@ func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectL } } -type InterconnectsPatchCall struct { - s *Service - project string - interconnect string - interconnect2 *Interconnect - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InterconnectsDeleteCall struct { + s *Service + project string + interconnect string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates the specified Interconnect with the data included in the -// request. This method supports PATCH semantics and uses the JSON merge patch -// format and processing rules. +// Delete: Deletes the specified Interconnect. // -// - interconnect: Name of the interconnect to update. +// - interconnect: Name of the interconnect to delete. // - project: Project ID for this request. -func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall { - c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) Delete(project string, interconnect string) *InterconnectsDeleteCall { + c := &InterconnectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.interconnect = interconnect - c.interconnect2 = interconnect2 return c } @@ -39247,7 +39019,7 @@ func (r *InterconnectsService) Patch(project string, interconnect string, interc // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall { +func (c *InterconnectsDeleteCall) RequestId(requestId string) *InterconnectsDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -39255,38 +39027,34 @@ func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatch // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall { +func (c *InterconnectsDeleteCall) Fields(s ...googleapi.Field) *InterconnectsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall { +func (c *InterconnectsDeleteCall) Context(ctx context.Context) *InterconnectsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectsPatchCall) Header() http.Header { +func (c *InterconnectsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *InterconnectsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -39298,12 +39066,12 @@ func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.patch" call. +// Do executes the "compute.interconnects.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InterconnectsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39335,81 +39103,87 @@ func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, e return ret, nil } -type InterconnectsSetLabelsCall struct { - s *Service - project string - resource string - globalsetlabelsrequest *GlobalSetLabelsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InterconnectsGetCall struct { + s *Service + project string + interconnect string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetLabels: Sets the labels on an Interconnect. To learn more about labels, -// read the Labeling Resources documentation. +// Get: Returns the specified Interconnect. Get a list of available +// Interconnects by making a list() request. // +// - interconnect: Name of the interconnect to return. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall { - c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) Get(project string, interconnect string) *InterconnectsGetCall { + c := &InterconnectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.globalsetlabelsrequest = globalsetlabelsrequest + c.interconnect = interconnect return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall { +func (c *InterconnectsGetCall) Fields(s ...googleapi.Field) *InterconnectsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// Context sets the context to be used in this call's Do method. -func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InterconnectsGetCall) IfNoneMatch(entityTag string) *InterconnectsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *InterconnectsGetCall) Context(ctx context.Context) *InterconnectsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *InterconnectsSetLabelsCall) Header() http.Header { +func (c *InterconnectsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) - if err != nil { - return nil, err +func (c *InterconnectsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{resource}/setLabels") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "interconnect": c.interconnect, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.interconnects.setLabels" call. +// Do executes the "compute.interconnects.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *Interconnect.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InterconnectsGetCall) Do(opts ...googleapi.CallOption) (*Interconnect, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39428,7 +39202,7 @@ func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operatio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Interconnect{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -39441,34 +39215,35 @@ func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type LicenseCodesGetCall struct { +type InterconnectsGetDiagnosticsCall struct { s *Service project string - licenseCode string + interconnect string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Return a specified license code. License codes are mirrored across all -// projects that have permissions to read the License Code. *Caution* This -// resource is intended for use only by third-party partners who are creating -// Cloud Marketplace images. +// GetDiagnostics: Returns the interconnectDiagnostics for the specified +// Interconnect. In the event of a global outage, do not use this API to make +// decisions about where to redirect your network traffic. Unlike a VLAN +// attachment, which is regional, a Cloud Interconnect connection is a global +// resource. A global outage can prevent this API from functioning properly. // -// - licenseCode: Number corresponding to the License code resource to return. +// - interconnect: Name of the interconnect resource to query. // - project: Project ID for this request. -func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall { - c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) GetDiagnostics(project string, interconnect string) *InterconnectsGetDiagnosticsCall { + c := &InterconnectsGetDiagnosticsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.licenseCode = licenseCode + c.interconnect = interconnect return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall { +func (c *InterconnectsGetDiagnosticsCall) Fields(s ...googleapi.Field) *InterconnectsGetDiagnosticsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -39476,27 +39251,27 @@ func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall { +func (c *InterconnectsGetDiagnosticsCall) IfNoneMatch(entityTag string) *InterconnectsGetDiagnosticsCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall { +func (c *InterconnectsGetDiagnosticsCall) Context(ctx context.Context) *InterconnectsGetDiagnosticsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicenseCodesGetCall) Header() http.Header { +func (c *InterconnectsGetDiagnosticsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectsGetDiagnosticsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -39504,7 +39279,7 @@ func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{licenseCode}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getDiagnostics") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -39512,18 +39287,19 @@ func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "licenseCode": c.licenseCode, + "project": c.project, + "interconnect": c.interconnect, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenseCodes.get" call. +// Do executes the "compute.interconnects.getDiagnostics" call. // Any non-2xx status code is an error. Response headers are in either -// *LicenseCode.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) { +// *InterconnectsGetDiagnosticsResponse.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *InterconnectsGetDiagnosticsCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetDiagnosticsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39542,7 +39318,7 @@ func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LicenseCode{ + ret := &InterconnectsGetDiagnosticsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -39555,83 +39331,88 @@ func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, er return ret, nil } -type LicenseCodesTestIamPermissionsCall struct { - s *Service - project string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InterconnectsGetMacsecConfigCall struct { + s *Service + project string + interconnect string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. *Caution* This resource is intended for use only by third-party -// partners who are creating Cloud Marketplace images. +// GetMacsecConfig: Returns the interconnectMacsecConfig for the specified +// Interconnect. // +// - interconnect: Name of the interconnect resource to query. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall { - c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) GetMacsecConfig(project string, interconnect string) *InterconnectsGetMacsecConfigCall { + c := &InterconnectsGetMacsecConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.interconnect = interconnect return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall { +func (c *InterconnectsGetMacsecConfigCall) Fields(s ...googleapi.Field) *InterconnectsGetMacsecConfigCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *InterconnectsGetMacsecConfigCall) IfNoneMatch(entityTag string) *InterconnectsGetMacsecConfigCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall { +func (c *InterconnectsGetMacsecConfigCall) Context(ctx context.Context) *InterconnectsGetMacsecConfigCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header { +func (c *InterconnectsGetMacsecConfigCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err +func (c *InterconnectsGetMacsecConfigCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}/getMacsecConfig") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "interconnect": c.interconnect, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenseCodes.testIamPermissions" call. +// Do executes the "compute.interconnects.getMacsecConfig" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *InterconnectsGetMacsecConfigResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +func (c *InterconnectsGetMacsecConfigCall) Do(opts ...googleapi.CallOption) (*InterconnectsGetMacsecConfigResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39650,7 +39431,7 @@ func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &InterconnectsGetMacsecConfigResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -39663,25 +39444,23 @@ func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type LicensesDeleteCall struct { - s *Service - project string - license string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type InterconnectsInsertCall struct { + s *Service + project string + interconnect *Interconnect + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified license. *Caution* This resource is intended -// for use only by third-party partners who are creating Cloud Marketplace -// images. +// Insert: Creates an Interconnect in the specified project using the data +// included in the request. // -// - license: Name of the license resource to delete. // - project: Project ID for this request. -func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall { - c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) Insert(project string, interconnect *Interconnect) *InterconnectsInsertCall { + c := &InterconnectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.license = license + c.interconnect = interconnect return c } @@ -39695,7 +39474,7 @@ func (r *LicensesService) Delete(project string, license string) *LicensesDelete // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall { +func (c *InterconnectsInsertCall) RequestId(requestId string) *InterconnectsInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -39703,51 +39482,54 @@ func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall { +func (c *InterconnectsInsertCall) Fields(s ...googleapi.Field) *InterconnectsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall { +func (c *InterconnectsInsertCall) Context(ctx context.Context) *InterconnectsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicensesDeleteCall) Header() http.Header { +func (c *InterconnectsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *InterconnectsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "license": c.license, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenses.delete" call. +// Do executes the "compute.interconnects.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InterconnectsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39779,153 +39561,107 @@ func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error return ret, nil } -type LicensesGetCall struct { +type InterconnectsListCall struct { s *Service project string - license string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns the specified License resource. *Caution* This resource is -// intended for use only by third-party partners who are creating Cloud -// Marketplace images. +// List: Retrieves the list of Interconnects available to the specified +// project. // -// - license: Name of the License resource to return. // - project: Project ID for this request. -func (r *LicensesService) Get(project string, license string) *LicensesGetCall { - c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) List(project string) *InterconnectsListCall { + c := &InterconnectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.license = license - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall { - c.ctx_ = ctx return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *LicensesGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "license": c.license, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *InterconnectsListCall) Filter(filter string) *InterconnectsListCall { + c.urlParams_.Set("filter", filter) + return c } -// Do executes the "compute.licenses.get" call. -// Any non-2xx status code is an error. Response headers are in either -// *License.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &License{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *InterconnectsListCall) MaxResults(maxResults int64) *InterconnectsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c } -type LicensesGetIamPolicyCall struct { - s *Service - project string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *InterconnectsListCall) OrderBy(orderBy string) *InterconnectsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. *Caution* This resource is intended for -// use only by third-party partners who are creating Cloud Marketplace images. -// -// - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall { - c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.resource = resource +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *InterconnectsListCall) PageToken(pageToken string) *InterconnectsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *LicensesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *LicensesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *InterconnectsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *InterconnectsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall { +func (c *InterconnectsListCall) Fields(s ...googleapi.Field) *InterconnectsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -39933,27 +39669,27 @@ func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamP // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall { +func (c *InterconnectsListCall) IfNoneMatch(entityTag string) *InterconnectsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall { +func (c *InterconnectsListCall) Context(ctx context.Context) *InterconnectsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicensesGetIamPolicyCall) Header() http.Header { +func (c *InterconnectsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -39961,7 +39697,7 @@ func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -39969,18 +39705,18 @@ func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenses.getIamPolicy" call. +// Do executes the "compute.interconnects.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *InterconnectList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *InterconnectsListCall) Do(opts ...googleapi.CallOption) (*InterconnectList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -39999,7 +39735,7 @@ func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &InterconnectList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -40012,24 +39748,48 @@ func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, er return ret, nil } -type LicensesInsertCall struct { - s *Service - project string - license *License - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *InterconnectsListCall) Pages(ctx context.Context, f func(*InterconnectList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Insert: Create a License resource in the specified project. *Caution* This -// resource is intended for use only by third-party partners who are creating -// Cloud Marketplace images. +type InterconnectsPatchCall struct { + s *Service + project string + interconnect string + interconnect2 *Interconnect + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the specified Interconnect with the data included in the +// request. This method supports PATCH semantics and uses the JSON merge patch +// format and processing rules. // +// - interconnect: Name of the interconnect to update. // - project: Project ID for this request. -func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall { - c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *InterconnectsService) Patch(project string, interconnect string, interconnect2 *Interconnect) *InterconnectsPatchCall { + c := &InterconnectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.license = license + c.interconnect = interconnect + c.interconnect2 = interconnect2 return c } @@ -40043,7 +39803,7 @@ func (r *LicensesService) Insert(project string, license *License) *LicensesInse // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall { +func (c *InterconnectsPatchCall) RequestId(requestId string) *InterconnectsPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -40051,54 +39811,55 @@ func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall { +func (c *InterconnectsPatchCall) Fields(s ...googleapi.Field) *InterconnectsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall { +func (c *InterconnectsPatchCall) Context(ctx context.Context) *InterconnectsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicensesInsertCall) Header() http.Header { +func (c *InterconnectsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *InterconnectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.license) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.interconnect2) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{interconnect}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "interconnect": c.interconnect, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenses.insert" call. +// Do executes the "compute.interconnects.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *InterconnectsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40130,167 +39891,81 @@ func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error return ret, nil } -type LicensesListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type InterconnectsSetLabelsCall struct { + s *Service + project string + resource string + globalsetlabelsrequest *GlobalSetLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Retrieves the list of licenses available in the specified project. -// This method does not get any licenses that belong to other projects, -// including licenses attached to publicly-available images, like Debian 9. If -// you want to get a list of publicly-available licenses, use this method to -// make a request to the respective image project, such as debian-cloud or -// windows-cloud. *Caution* This resource is intended for use only by -// third-party partners who are creating Cloud Marketplace images. +// SetLabels: Sets the labels on an Interconnect. To learn more about labels, +// read the Labeling Resources documentation. // // - project: Project ID for this request. -func (r *LicensesService) List(project string) *LicensesListCall { - c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *InterconnectsService) SetLabels(project string, resource string, globalsetlabelsrequest *GlobalSetLabelsRequest) *InterconnectsSetLabelsCall { + c := &InterconnectsSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *LicensesListCall) Filter(filter string) *LicensesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *LicensesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *LicensesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + c.resource = resource + c.globalsetlabelsrequest = globalsetlabelsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall { +func (c *InterconnectsSetLabelsCall) Fields(s ...googleapi.Field) *InterconnectsSetLabelsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall { +func (c *InterconnectsSetLabelsCall) Context(ctx context.Context) *InterconnectsSetLabelsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicensesListCall) Header() http.Header { +func (c *InterconnectsSetLabelsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *InterconnectsSetLabelsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetlabelsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/interconnects/{resource}/setLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenses.list" call. +// Do executes the "compute.interconnects.setLabels" call. // Any non-2xx status code is an error. Response headers are in either -// *LicensesListResponse.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *InterconnectsSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40309,7 +39984,7 @@ func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListRespon if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &LicensesListResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -40322,103 +39997,89 @@ func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListRespon return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type LicensesSetIamPolicyCall struct { - s *Service - project string - resource string - globalsetpolicyrequest *GlobalSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LicenseCodesGetCall struct { + s *Service + project string + licenseCode string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. *Caution* This resource is intended for use -// only by third-party partners who are creating Cloud Marketplace images. +// Get: Return a specified license code. License codes are mirrored across all +// projects that have permissions to read the License Code. *Caution* This +// resource is intended for use only by third-party partners who are creating +// Cloud Marketplace images. // +// - licenseCode: Number corresponding to the License code resource to return. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall { - c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicenseCodesService) Get(project string, licenseCode string) *LicenseCodesGetCall { + c := &LicenseCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.globalsetpolicyrequest = globalsetpolicyrequest + c.licenseCode = licenseCode return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall { +func (c *LicenseCodesGetCall) Fields(s ...googleapi.Field) *LicenseCodesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *LicenseCodesGetCall) IfNoneMatch(entityTag string) *LicenseCodesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall { +func (c *LicenseCodesGetCall) Context(ctx context.Context) *LicenseCodesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicensesSetIamPolicyCall) Header() http.Header { +func (c *LicenseCodesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) - if err != nil { - return nil, err +func (c *LicenseCodesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{licenseCode}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "licenseCode": c.licenseCode, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenses.setIamPolicy" call. +// Do executes the "compute.licenseCodes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *LicenseCode.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *LicenseCodesGetCall) Do(opts ...googleapi.CallOption) (*LicenseCode, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40437,7 +40098,7 @@ func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &LicenseCode{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -40450,7 +40111,7 @@ func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, er return ret, nil } -type LicensesTestIamPermissionsCall struct { +type LicenseCodesTestIamPermissionsCall struct { s *Service project string resource string @@ -40466,8 +40127,8 @@ type LicensesTestIamPermissionsCall struct { // // - project: Project ID for this request. // - resource: Name or id of the resource for this request. -func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall { - c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicenseCodesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicenseCodesTestIamPermissionsCall { + c := &LicenseCodesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.resource = resource c.testpermissionsrequest = testpermissionsrequest @@ -40477,27 +40138,27 @@ func (r *LicensesService) TestIamPermissions(project string, resource string, te // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall { +func (c *LicenseCodesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicenseCodesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall { +func (c *LicenseCodesTestIamPermissionsCall) Context(ctx context.Context) *LicenseCodesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *LicensesTestIamPermissionsCall) Header() http.Header { +func (c *LicenseCodesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *LicenseCodesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) @@ -40506,7 +40167,7 @@ func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenseCodes/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -40520,13 +40181,13 @@ func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.licenses.testIamPermissions" call. +// Do executes the "compute.licenseCodes.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either // *TestPermissionsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +func (c *LicenseCodesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40558,24 +40219,25 @@ func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*Test return ret, nil } -type MachineImagesDeleteCall struct { - s *Service - project string - machineImage string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LicensesDeleteCall struct { + s *Service + project string + license string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified machine image. Deleting a machine image is -// permanent and cannot be undone. +// Delete: Deletes the specified license. *Caution* This resource is intended +// for use only by third-party partners who are creating Cloud Marketplace +// images. // -// - machineImage: The name of the machine image to delete. +// - license: Name of the license resource to delete. // - project: Project ID for this request. -func (r *MachineImagesService) Delete(project string, machineImage string) *MachineImagesDeleteCall { - c := &MachineImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) Delete(project string, license string) *LicensesDeleteCall { + c := &LicensesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.machineImage = machineImage + c.license = license return c } @@ -40589,7 +40251,7 @@ func (r *MachineImagesService) Delete(project string, machineImage string) *Mach // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDeleteCall { +func (c *LicensesDeleteCall) RequestId(requestId string) *LicensesDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -40597,32 +40259,32 @@ func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDele // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesDeleteCall) Fields(s ...googleapi.Field) *MachineImagesDeleteCall { +func (c *LicensesDeleteCall) Fields(s ...googleapi.Field) *LicensesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesDeleteCall) Context(ctx context.Context) *MachineImagesDeleteCall { +func (c *LicensesDeleteCall) Context(ctx context.Context) *LicensesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesDeleteCall) Header() http.Header { +func (c *LicensesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -40630,18 +40292,18 @@ func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "machineImage": c.machineImage, + "project": c.project, + "license": c.license, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.delete" call. +// Do executes the "compute.licenses.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *LicensesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40673,31 +40335,33 @@ func (c *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type MachineImagesGetCall struct { +type LicensesGetCall struct { s *Service project string - machineImage string + license string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns the specified machine image. +// Get: Returns the specified License resource. *Caution* This resource is +// intended for use only by third-party partners who are creating Cloud +// Marketplace images. // -// - machineImage: The name of the machine image. +// - license: Name of the License resource to return. // - project: Project ID for this request. -func (r *MachineImagesService) Get(project string, machineImage string) *MachineImagesGetCall { - c := &MachineImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) Get(project string, license string) *LicensesGetCall { + c := &LicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.machineImage = machineImage + c.license = license return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCall { +func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -40705,27 +40369,27 @@ func (c *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCal // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *MachineImagesGetCall) IfNoneMatch(entityTag string) *MachineImagesGetCall { +func (c *LicensesGetCall) IfNoneMatch(entityTag string) *LicensesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesGetCall) Context(ctx context.Context) *MachineImagesGetCall { +func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesGetCall) Header() http.Header { +func (c *LicensesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -40733,7 +40397,7 @@ func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{license}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -40741,18 +40405,18 @@ func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "machineImage": c.machineImage, + "project": c.project, + "license": c.license, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.get" call. +// Do executes the "compute.licenses.get" call. // Any non-2xx status code is an error. Response headers are in either -// *MachineImage.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *License.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, error) { +func (c *LicensesGetCall) Do(opts ...googleapi.CallOption) (*License, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40771,7 +40435,7 @@ func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &MachineImage{ + ret := &License{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -40784,7 +40448,7 @@ func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, return ret, nil } -type MachineImagesGetIamPolicyCall struct { +type LicensesGetIamPolicyCall struct { s *Service project string resource string @@ -40795,12 +40459,13 @@ type MachineImagesGetIamPolicyCall struct { } // GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// no such policy or resource exists. *Caution* This resource is intended for +// use only by third-party partners who are creating Cloud Marketplace images. // // - project: Project ID for this request. // - resource: Name or id of the resource for this request. -func (r *MachineImagesService) GetIamPolicy(project string, resource string) *MachineImagesGetIamPolicyCall { - c := &MachineImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) GetIamPolicy(project string, resource string) *LicensesGetIamPolicyCall { + c := &LicensesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.resource = resource return c @@ -40808,7 +40473,7 @@ func (r *MachineImagesService) GetIamPolicy(project string, resource string) *Ma // OptionsRequestedPolicyVersion sets the optional parameter // "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *MachineImagesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *MachineImagesGetIamPolicyCall { +func (c *LicensesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *LicensesGetIamPolicyCall { c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } @@ -40816,7 +40481,7 @@ func (c *MachineImagesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsReq // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesGetIamPolicyCall { +func (c *LicensesGetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -40824,27 +40489,27 @@ func (c *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineIma // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *MachineImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *MachineImagesGetIamPolicyCall { +func (c *LicensesGetIamPolicyCall) IfNoneMatch(entityTag string) *LicensesGetIamPolicyCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesGetIamPolicyCall) Context(ctx context.Context) *MachineImagesGetIamPolicyCall { +func (c *LicensesGetIamPolicyCall) Context(ctx context.Context) *LicensesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesGetIamPolicyCall) Header() http.Header { +func (c *LicensesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -40852,7 +40517,7 @@ func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, e var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -40866,12 +40531,12 @@ func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.getIamPolicy" call. +// Do executes the "compute.licenses.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either // *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *LicensesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -40903,25 +40568,24 @@ func (c *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Polic return ret, nil } -type MachineImagesInsertCall struct { - s *Service - project string - machineimage *MachineImage - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type LicensesInsertCall struct { + s *Service + project string + license *License + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a machine image in the specified project using the data that -// is included in the request. If you are creating a new machine image to -// update an existing instance, your new machine image should use the same -// network or, if applicable, the same subnetwork as the original instance. +// Insert: Create a License resource in the specified project. *Caution* This +// resource is intended for use only by third-party partners who are creating +// Cloud Marketplace images. // // - project: Project ID for this request. -func (r *MachineImagesService) Insert(project string, machineimage *MachineImage) *MachineImagesInsertCall { - c := &MachineImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) Insert(project string, license *License) *LicensesInsertCall { + c := &LicensesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.machineimage = machineimage + c.license = license return c } @@ -40935,51 +40599,44 @@ func (r *MachineImagesService) Insert(project string, machineimage *MachineImage // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *MachineImagesInsertCall) RequestId(requestId string) *MachineImagesInsertCall { +func (c *LicensesInsertCall) RequestId(requestId string) *LicensesInsertCall { c.urlParams_.Set("requestId", requestId) return c } -// SourceInstance sets the optional parameter "sourceInstance": Required. -// Source instance that is used to create the machine image from. -func (c *MachineImagesInsertCall) SourceInstance(sourceInstance string) *MachineImagesInsertCall { - c.urlParams_.Set("sourceInstance", sourceInstance) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesInsertCall) Fields(s ...googleapi.Field) *MachineImagesInsertCall { +func (c *LicensesInsertCall) Fields(s ...googleapi.Field) *LicensesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesInsertCall) Context(ctx context.Context) *MachineImagesInsertCall { +func (c *LicensesInsertCall) Context(ctx context.Context) *LicensesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesInsertCall) Header() http.Header { +func (c *LicensesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.license) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -40992,12 +40649,12 @@ func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.insert" call. +// Do executes the "compute.licenses.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *LicensesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41029,7 +40686,7 @@ func (c *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type MachineImagesListCall struct { +type LicensesListCall struct { s *Service project string urlParams_ gensupport.URLParams @@ -41038,12 +40695,17 @@ type MachineImagesListCall struct { header_ http.Header } -// List: Retrieves a list of machine images that are contained within the -// specified project. +// List: Retrieves the list of licenses available in the specified project. +// This method does not get any licenses that belong to other projects, +// including licenses attached to publicly-available images, like Debian 9. If +// you want to get a list of publicly-available licenses, use this method to +// make a request to the respective image project, such as debian-cloud or +// windows-cloud. *Caution* This resource is intended for use only by +// third-party partners who are creating Cloud Marketplace images. // // - project: Project ID for this request. -func (r *MachineImagesService) List(project string) *MachineImagesListCall { - c := &MachineImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) List(project string) *LicensesListCall { + c := &LicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } @@ -41080,7 +40742,7 @@ func (r *MachineImagesService) List(project string) *MachineImagesListCall { // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall { +func (c *LicensesListCall) Filter(filter string) *LicensesListCall { c.urlParams_.Set("filter", filter) return c } @@ -41090,7 +40752,7 @@ func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall { // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListCall { +func (c *LicensesListCall) MaxResults(maxResults int64) *LicensesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -41103,7 +40765,7 @@ func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListC // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall { +func (c *LicensesListCall) OrderBy(orderBy string) *LicensesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -41111,7 +40773,7 @@ func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall { // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCall { +func (c *LicensesListCall) PageToken(pageToken string) *LicensesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -41121,7 +40783,7 @@ func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCa // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *MachineImagesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineImagesListCall { +func (c *LicensesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *LicensesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -41129,7 +40791,7 @@ func (c *MachineImagesListCall) ReturnPartialSuccess(returnPartialSuccess bool) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListCall { +func (c *LicensesListCall) Fields(s ...googleapi.Field) *LicensesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -41137,27 +40799,27 @@ func (c *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListC // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *MachineImagesListCall) IfNoneMatch(entityTag string) *MachineImagesListCall { +func (c *LicensesListCall) IfNoneMatch(entityTag string) *LicensesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesListCall) Context(ctx context.Context) *MachineImagesListCall { +func (c *LicensesListCall) Context(ctx context.Context) *LicensesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesListCall) Header() http.Header { +func (c *LicensesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -41165,7 +40827,7 @@ func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -41178,13 +40840,13 @@ func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.list" call. +// Do executes the "compute.licenses.list" call. // Any non-2xx status code is an error. Response headers are in either -// *MachineImageList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// *LicensesListResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageList, error) { +func (c *LicensesListCall) Do(opts ...googleapi.CallOption) (*LicensesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41203,7 +40865,7 @@ func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageL if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &MachineImageList{ + ret := &LicensesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -41219,7 +40881,7 @@ func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageL // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageList) error) error { +func (c *LicensesListCall) Pages(ctx context.Context, f func(*LicensesListResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -41237,7 +40899,7 @@ func (c *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageL } } -type MachineImagesSetIamPolicyCall struct { +type LicensesSetIamPolicyCall struct { s *Service project string resource string @@ -41248,12 +40910,13 @@ type MachineImagesSetIamPolicyCall struct { } // SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// Replaces any existing policy. *Caution* This resource is intended for use +// only by third-party partners who are creating Cloud Marketplace images. // // - project: Project ID for this request. // - resource: Name or id of the resource for this request. -func (r *MachineImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *MachineImagesSetIamPolicyCall { - c := &MachineImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *LicensesSetIamPolicyCall { + c := &LicensesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.resource = resource c.globalsetpolicyrequest = globalsetpolicyrequest @@ -41263,27 +40926,27 @@ func (r *MachineImagesService) SetIamPolicy(project string, resource string, glo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesSetIamPolicyCall { +func (c *LicensesSetIamPolicyCall) Fields(s ...googleapi.Field) *LicensesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesSetIamPolicyCall) Context(ctx context.Context) *MachineImagesSetIamPolicyCall { +func (c *LicensesSetIamPolicyCall) Context(ctx context.Context) *LicensesSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesSetIamPolicyCall) Header() http.Header { +func (c *LicensesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) @@ -41292,7 +40955,7 @@ func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, e } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -41306,12 +40969,12 @@ func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.setIamPolicy" call. +// Do executes the "compute.licenses.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either // *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *LicensesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41343,7 +41006,7 @@ func (c *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Polic return ret, nil } -type MachineImagesTestIamPermissionsCall struct { +type LicensesTestIamPermissionsCall struct { s *Service project string resource string @@ -41354,12 +41017,13 @@ type MachineImagesTestIamPermissionsCall struct { } // TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// resource. *Caution* This resource is intended for use only by third-party +// partners who are creating Cloud Marketplace images. // // - project: Project ID for this request. // - resource: Name or id of the resource for this request. -func (r *MachineImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *MachineImagesTestIamPermissionsCall { - c := &MachineImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *LicensesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *LicensesTestIamPermissionsCall { + c := &LicensesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.resource = resource c.testpermissionsrequest = testpermissionsrequest @@ -41369,27 +41033,27 @@ func (r *MachineImagesService) TestIamPermissions(project string, resource strin // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *MachineImagesTestIamPermissionsCall { +func (c *LicensesTestIamPermissionsCall) Fields(s ...googleapi.Field) *LicensesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *MachineImagesTestIamPermissionsCall) Context(ctx context.Context) *MachineImagesTestIamPermissionsCall { +func (c *LicensesTestIamPermissionsCall) Context(ctx context.Context) *LicensesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineImagesTestIamPermissionsCall) Header() http.Header { +func (c *LicensesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *LicensesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) @@ -41398,7 +41062,7 @@ func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Respo } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/licenses/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -41412,13 +41076,13 @@ func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineImages.testIamPermissions" call. +// Do executes the "compute.licenses.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either // *TestPermissionsResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +func (c *LicensesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41450,184 +41114,90 @@ func (c *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type MachineTypesAggregatedListCall struct { +type MachineImagesDeleteCall struct { s *Service project string + machineImage string urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves an aggregated list of machine types. To prevent -// failure, Google recommends that you set the `returnPartialSuccess` parameter -// to `true`. +// Delete: Deletes the specified machine image. Deleting a machine image is +// permanent and cannot be undone. // +// - machineImage: The name of the machine image to delete. // - project: Project ID for this request. -func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { - c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *MachineImagesService) Delete(project string, machineImage string) *MachineImagesDeleteCall { + c := &MachineImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.machineImage = machineImage return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *MachineTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *MachineTypesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *MachineTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineTypesAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *MachineTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *MachineTypesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *MachineImagesDeleteCall) RequestId(requestId string) *MachineImagesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall { +func (c *MachineImagesDeleteCall) Fields(s ...googleapi.Field) *MachineImagesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall { +func (c *MachineImagesDeleteCall) Context(ctx context.Context) *MachineImagesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineTypesAggregatedListCall) Header() http.Header { +func (c *MachineImagesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *MachineImagesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/machineTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "machineImage": c.machineImage, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineTypes.aggregatedList" call. +// Do executes the "compute.machineImages.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *MachineTypeAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *MachineImagesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41646,7 +41216,7 @@ func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Mach if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &MachineTypeAggregatedList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -41659,55 +41229,31 @@ func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Mach return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type MachineTypesGetCall struct { +type MachineImagesGetCall struct { s *Service project string - zone string - machineType string + machineImage string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns the specified machine type. +// Get: Returns the specified machine image. // -// - machineType: Name of the machine type to return. +// - machineImage: The name of the machine image. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall { - c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *MachineImagesService) Get(project string, machineImage string) *MachineImagesGetCall { + c := &MachineImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.machineType = machineType + c.machineImage = machineImage return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall { +func (c *MachineImagesGetCall) Fields(s ...googleapi.Field) *MachineImagesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -41715,27 +41261,27 @@ func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall { +func (c *MachineImagesGetCall) IfNoneMatch(entityTag string) *MachineImagesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall { +func (c *MachineImagesGetCall) Context(ctx context.Context) *MachineImagesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineTypesGetCall) Header() http.Header { +func (c *MachineImagesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *MachineImagesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -41743,7 +41289,7 @@ func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes/{machineType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{machineImage}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -41751,19 +41297,18 @@ func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "machineType": c.machineType, + "project": c.project, + "machineImage": c.machineImage, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineTypes.get" call. +// Do executes the "compute.machineImages.get" call. // Any non-2xx status code is an error. Response headers are in either -// *MachineType.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *MachineImage.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) { +func (c *MachineImagesGetCall) Do(opts ...googleapi.CallOption) (*MachineImage, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41782,7 +41327,7 @@ func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &MachineType{ + ret := &MachineImage{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -41795,109 +41340,39 @@ func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, er return ret, nil } -type MachineTypesListCall struct { +type MachineImagesGetIamPolicyCall struct { s *Service project string - zone string + resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of machine types available to the specified project. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { - c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *MachineImagesService) GetIamPolicy(project string, resource string) *MachineImagesGetIamPolicyCall { + c := &MachineImagesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { - c.urlParams_.Set("pageToken", pageToken) + c.resource = resource return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *MachineTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineTypesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *MachineImagesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *MachineImagesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall { +func (c *MachineImagesGetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -41905,27 +41380,27 @@ func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCal // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall { +func (c *MachineImagesGetIamPolicyCall) IfNoneMatch(entityTag string) *MachineImagesGetIamPolicyCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall { +func (c *MachineImagesGetIamPolicyCall) Context(ctx context.Context) *MachineImagesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *MachineTypesListCall) Header() http.Header { +func (c *MachineImagesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { +func (c *MachineImagesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -41933,7 +41408,7 @@ func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -41941,19 +41416,18 @@ func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.machineTypes.list" call. +// Do executes the "compute.machineImages.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *MachineTypeList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) { +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *MachineImagesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -41972,7 +41446,7 @@ func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeLis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &MachineTypeList{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -41985,151 +41459,233 @@ func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeLis return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NetworkAttachmentsAggregatedListCall struct { +type MachineImagesInsertCall struct { s *Service project string + machineimage *MachineImage urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves the list of all NetworkAttachment resources, -// regional and global, available to the specified project. To prevent failure, -// Google recommends that you set the `returnPartialSuccess` parameter to -// `true`. +// Insert: Creates a machine image in the specified project using the data that +// is included in the request. If you are creating a new machine image to +// update an existing instance, your new machine image should use the same +// network or, if applicable, the same subnetwork as the original instance. // // - project: Project ID for this request. -func (r *NetworkAttachmentsService) AggregatedList(project string) *NetworkAttachmentsAggregatedListCall { - c := &NetworkAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *MachineImagesService) Insert(project string, machineimage *MachineImage) *MachineImagesInsertCall { + c := &MachineImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.machineimage = machineimage return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NetworkAttachmentsAggregatedListCall) Filter(filter string) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *NetworkAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *MachineImagesInsertCall) RequestId(requestId string) *MachineImagesInsertCall { + c.urlParams_.Set("requestId", requestId) return c } -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkAttachmentsAggregatedListCall) MaxResults(maxResults int64) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// SourceInstance sets the optional parameter "sourceInstance": Required. +// Source instance that is used to create the machine image from. +func (c *MachineImagesInsertCall) SourceInstance(sourceInstance string) *MachineImagesInsertCall { + c.urlParams_.Set("sourceInstance", sourceInstance) return c } -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkAttachmentsAggregatedListCall) OrderBy(orderBy string) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *MachineImagesInsertCall) Fields(s ...googleapi.Field) *MachineImagesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NetworkAttachmentsAggregatedListCall) PageToken(pageToken string) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) +// Context sets the context to be used in this call's Do method. +func (c *MachineImagesInsertCall) Context(ctx context.Context) *MachineImagesInsertCall { + c.ctx_ = ctx return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NetworkAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *MachineImagesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *NetworkAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkAttachmentsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +func (c *MachineImagesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.machineimage) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.machineImages.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *MachineImagesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type MachineImagesListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves a list of machine images that are contained within the +// specified project. +// +// - project: Project ID for this request. +func (r *MachineImagesService) List(project string) *MachineImagesListCall { + c := &MachineImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *MachineImagesListCall) Filter(filter string) *MachineImagesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *MachineImagesListCall) MaxResults(maxResults int64) *MachineImagesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *MachineImagesListCall) OrderBy(orderBy string) *MachineImagesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *MachineImagesListCall) PageToken(pageToken string) *MachineImagesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *MachineImagesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineImagesListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkAttachmentsAggregatedListCall { +func (c *MachineImagesListCall) Fields(s ...googleapi.Field) *MachineImagesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -42137,27 +41693,27 @@ func (c *NetworkAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *Net // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkAttachmentsAggregatedListCall { +func (c *MachineImagesListCall) IfNoneMatch(entityTag string) *MachineImagesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsAggregatedListCall) Context(ctx context.Context) *NetworkAttachmentsAggregatedListCall { +func (c *MachineImagesListCall) Context(ctx context.Context) *MachineImagesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsAggregatedListCall) Header() http.Header { +func (c *MachineImagesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *MachineImagesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -42165,7 +41721,7 @@ func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -42178,13 +41734,13 @@ func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.aggregatedList" call. +// Do executes the "compute.machineImages.list" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkAttachmentAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkAttachmentAggregatedList, error) { +// *MachineImageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *MachineImagesListCall) Do(opts ...googleapi.CallOption) (*MachineImageList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -42203,7 +41759,7 @@ func (c *NetworkAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkAttachmentAggregatedList{ + ret := &MachineImageList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -42219,7 +41775,7 @@ func (c *NetworkAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NetworkAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkAttachmentAggregatedList) error) error { +func (c *MachineImagesListCall) Pages(ctx context.Context, f func(*MachineImageList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -42237,94 +41793,81 @@ func (c *NetworkAttachmentsAggregatedListCall) Pages(ctx context.Context, f func } } -type NetworkAttachmentsDeleteCall struct { - s *Service - project string - region string - networkAttachment string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type MachineImagesSetIamPolicyCall struct { + s *Service + project string + resource string + globalsetpolicyrequest *GlobalSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified NetworkAttachment in the given scope +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - networkAttachment: Name of the NetworkAttachment resource to delete. // - project: Project ID for this request. -// - region: Name of the region of this request. -func (r *NetworkAttachmentsService) Delete(project string, region string, networkAttachment string) *NetworkAttachmentsDeleteCall { - c := &NetworkAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *MachineImagesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *MachineImagesSetIamPolicyCall { + c := &MachineImagesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.networkAttachment = networkAttachment - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). end_interface: -// MixerMutationRequestBuilder -func (c *NetworkAttachmentsDeleteCall) RequestId(requestId string) *NetworkAttachmentsDeleteCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.globalsetpolicyrequest = globalsetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsDeleteCall) Fields(s ...googleapi.Field) *NetworkAttachmentsDeleteCall { +func (c *MachineImagesSetIamPolicyCall) Fields(s ...googleapi.Field) *MachineImagesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsDeleteCall) Context(ctx context.Context) *NetworkAttachmentsDeleteCall { +func (c *MachineImagesSetIamPolicyCall) Context(ctx context.Context) *MachineImagesSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsDeleteCall) Header() http.Header { +func (c *MachineImagesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *MachineImagesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "networkAttachment": c.networkAttachment, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.delete" call. +// Do executes the "compute.machineImages.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *MachineImagesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -42343,7 +41886,7 @@ func (c *NetworkAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -42356,91 +41899,82 @@ func (c *NetworkAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operat return ret, nil } -type NetworkAttachmentsGetCall struct { - s *Service - project string - region string - networkAttachment string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type MachineImagesTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified NetworkAttachment resource in the given scope. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // -// - networkAttachment: Name of the NetworkAttachment resource to return. // - project: Project ID for this request. -// - region: Name of the region of this request. -func (r *NetworkAttachmentsService) Get(project string, region string, networkAttachment string) *NetworkAttachmentsGetCall { - c := &NetworkAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *MachineImagesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *MachineImagesTestIamPermissionsCall { + c := &MachineImagesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.networkAttachment = networkAttachment + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsGetCall) Fields(s ...googleapi.Field) *NetworkAttachmentsGetCall { +func (c *MachineImagesTestIamPermissionsCall) Fields(s ...googleapi.Field) *MachineImagesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworkAttachmentsGetCall) IfNoneMatch(entityTag string) *NetworkAttachmentsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsGetCall) Context(ctx context.Context) *NetworkAttachmentsGetCall { +func (c *MachineImagesTestIamPermissionsCall) Context(ctx context.Context) *MachineImagesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsGetCall) Header() http.Header { +func (c *MachineImagesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *MachineImagesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/machineImages/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "networkAttachment": c.networkAttachment, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.get" call. +// Do executes the "compute.machineImages.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkAttachment.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NetworkAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*NetworkAttachment, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MachineImagesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -42459,7 +41993,7 @@ func (c *NetworkAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*NetworkAt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkAttachment{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -42472,42 +42006,129 @@ func (c *NetworkAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*NetworkAt return ret, nil } -type NetworkAttachmentsGetIamPolicyCall struct { +type MachineTypesAggregatedListCall struct { s *Service project string - region string - resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// AggregatedList: Retrieves an aggregated list of machine types. To prevent +// failure, Google recommends that you set the `returnPartialSuccess` parameter +// to `true`. // // - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *NetworkAttachmentsService) GetIamPolicy(project string, region string, resource string) *NetworkAttachmentsGetIamPolicyCall { - c := &NetworkAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { + c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.resource = resource return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *NetworkAttachmentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NetworkAttachmentsGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *MachineTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *MachineTypesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *MachineTypesAggregatedListCall) OrderBy(orderBy string) *MachineTypesAggregatedListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *MachineTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineTypesAggregatedListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *MachineTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *MachineTypesAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkAttachmentsGetIamPolicyCall { +func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -42515,27 +42136,27 @@ func (c *NetworkAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *Netwo // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *NetworkAttachmentsGetIamPolicyCall { +func (c *MachineTypesAggregatedListCall) IfNoneMatch(entityTag string) *MachineTypesAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsGetIamPolicyCall) Context(ctx context.Context) *NetworkAttachmentsGetIamPolicyCall { +func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsGetIamPolicyCall) Header() http.Header { +func (c *MachineTypesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -42543,7 +42164,7 @@ func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/machineTypes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -42551,19 +42172,18 @@ func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Respon } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.getIamPolicy" call. +// Do executes the "compute.machineTypes.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *MachineTypeAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *MachineTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*MachineTypeAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -42582,7 +42202,7 @@ func (c *NetworkAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &MachineTypeAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -42595,97 +42215,111 @@ func (c *NetworkAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type NetworkAttachmentsInsertCall struct { - s *Service - project string - region string - networkattachment *NetworkAttachment - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a NetworkAttachment in the specified project in the given -// scope using the parameters that are included in the request. -// -// - project: Project ID for this request. -// - region: Name of the region of this request. -func (r *NetworkAttachmentsService) Insert(project string, region string, networkattachment *NetworkAttachment) *NetworkAttachmentsInsertCall { - c := &NetworkAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.networkattachment = networkattachment - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). end_interface: -// MixerMutationRequestBuilder -func (c *NetworkAttachmentsInsertCall) RequestId(requestId string) *NetworkAttachmentsInsertCall { - c.urlParams_.Set("requestId", requestId) +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *MachineTypesAggregatedListCall) Pages(ctx context.Context, f func(*MachineTypeAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type MachineTypesGetCall struct { + s *Service + project string + zone string + machineType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the specified machine type. +// +// - machineType: Name of the machine type to return. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall { + c := &MachineTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.machineType = machineType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsInsertCall) Fields(s ...googleapi.Field) *NetworkAttachmentsInsertCall { +func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *MachineTypesGetCall) IfNoneMatch(entityTag string) *MachineTypesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsInsertCall) Context(ctx context.Context) *NetworkAttachmentsInsertCall { +func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsInsertCall) Header() http.Header { +func (c *MachineTypesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) - if err != nil { - return nil, err +func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes/{machineType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "zone": c.zone, + "machineType": c.machineType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.insert" call. +// Do executes the "compute.machineTypes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *MachineType.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *MachineTypesGetCall) Do(opts ...googleapi.CallOption) (*MachineType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -42704,7 +42338,7 @@ func (c *NetworkAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operat if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &MachineType{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -42717,24 +42351,24 @@ func (c *NetworkAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operat return ret, nil } -type NetworkAttachmentsListCall struct { +type MachineTypesListCall struct { s *Service project string - region string + zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the NetworkAttachments for a project in the given scope. +// List: Retrieves a list of machine types available to the specified project. // // - project: Project ID for this request. -// - region: Name of the region of this request. -func (r *NetworkAttachmentsService) List(project string, region string) *NetworkAttachmentsListCall { - c := &NetworkAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { + c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region + c.zone = zone return c } @@ -42770,7 +42404,7 @@ func (r *NetworkAttachmentsService) List(project string, region string) *Network // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NetworkAttachmentsListCall) Filter(filter string) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { c.urlParams_.Set("filter", filter) return c } @@ -42780,7 +42414,7 @@ func (c *NetworkAttachmentsListCall) Filter(filter string) *NetworkAttachmentsLi // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkAttachmentsListCall) MaxResults(maxResults int64) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -42793,7 +42427,7 @@ func (c *NetworkAttachmentsListCall) MaxResults(maxResults int64) *NetworkAttach // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkAttachmentsListCall) OrderBy(orderBy string) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) OrderBy(orderBy string) *MachineTypesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -42801,7 +42435,7 @@ func (c *NetworkAttachmentsListCall) OrderBy(orderBy string) *NetworkAttachments // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *NetworkAttachmentsListCall) PageToken(pageToken string) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -42811,7 +42445,7 @@ func (c *NetworkAttachmentsListCall) PageToken(pageToken string) *NetworkAttachm // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NetworkAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *MachineTypesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -42819,7 +42453,7 @@ func (c *NetworkAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess b // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsListCall) Fields(s ...googleapi.Field) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -42827,27 +42461,27 @@ func (c *NetworkAttachmentsListCall) Fields(s ...googleapi.Field) *NetworkAttach // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkAttachmentsListCall) IfNoneMatch(entityTag string) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) IfNoneMatch(entityTag string) *MachineTypesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsListCall) Context(ctx context.Context) *NetworkAttachmentsListCall { +func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsListCall) Header() http.Header { +func (c *MachineTypesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, error) { +func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -42855,7 +42489,7 @@ func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/machineTypes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -42864,18 +42498,18 @@ func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, erro req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "region": c.region, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.list" call. +// Do executes the "compute.machineTypes.list" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkAttachmentList.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// *MachineTypeList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *NetworkAttachmentsListCall) Do(opts ...googleapi.CallOption) (*NetworkAttachmentList, error) { +func (c *MachineTypesListCall) Do(opts ...googleapi.CallOption) (*MachineTypeList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -42894,7 +42528,7 @@ func (c *NetworkAttachmentsListCall) Do(opts ...googleapi.CallOption) (*NetworkA if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkAttachmentList{ + ret := &MachineTypeList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -42910,7 +42544,7 @@ func (c *NetworkAttachmentsListCall) Do(opts ...googleapi.CallOption) (*NetworkA // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NetworkAttachmentsListCall) Pages(ctx context.Context, f func(*NetworkAttachmentList) error) error { +func (c *MachineTypesListCall) Pages(ctx context.Context, f func(*MachineTypeList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -42928,102 +42562,185 @@ func (c *NetworkAttachmentsListCall) Pages(ctx context.Context, f func(*NetworkA } } -type NetworkAttachmentsPatchCall struct { - s *Service - project string - region string - networkAttachment string - networkattachment *NetworkAttachment - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkAttachmentsAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Patch: Patches the specified NetworkAttachment resource with the data -// included in the request. This method supports PATCH semantics and uses JSON -// merge patch format and processing rules. +// AggregatedList: Retrieves the list of all NetworkAttachment resources, +// regional and global, available to the specified project. To prevent failure, +// Google recommends that you set the `returnPartialSuccess` parameter to +// `true`. // -// - networkAttachment: Name of the NetworkAttachment resource to patch. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *NetworkAttachmentsService) Patch(project string, region string, networkAttachment string, networkattachment *NetworkAttachment) *NetworkAttachmentsPatchCall { - c := &NetworkAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkAttachmentsService) AggregatedList(project string) *NetworkAttachmentsAggregatedListCall { + c := &NetworkAttachmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.networkAttachment = networkAttachment - c.networkattachment = networkattachment return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). end_interface: -// MixerMutationRequestBuilder -func (c *NetworkAttachmentsPatchCall) RequestId(requestId string) *NetworkAttachmentsPatchCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NetworkAttachmentsAggregatedListCall) Filter(filter string) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("filter", filter) return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NetworkAttachmentsPatchCall) Fields(s ...googleapi.Field) *NetworkAttachmentsPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *NetworkAttachmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) return c } -// Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsPatchCall) Context(ctx context.Context) *NetworkAttachmentsPatchCall { - c.ctx_ = ctx +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NetworkAttachmentsAggregatedListCall) MaxResults(maxResults int64) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *NetworkAttachmentsPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NetworkAttachmentsAggregatedListCall) OrderBy(orderBy string) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NetworkAttachmentsAggregatedListCall) PageToken(pageToken string) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NetworkAttachmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *NetworkAttachmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworkAttachmentsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkAttachmentsAggregatedListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkAttachmentsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkAttachmentsAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *NetworkAttachmentsAggregatedListCall) Context(ctx context.Context) *NetworkAttachmentsAggregatedListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NetworkAttachmentsAggregatedListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } return c.header_ } -func (c *NetworkAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) - if err != nil { - return nil, err +func (c *NetworkAttachmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "networkAttachment": c.networkAttachment, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.patch" call. +// Do executes the "compute.networkAttachments.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *NetworkAttachmentAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkAttachmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkAttachmentAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43042,7 +42759,7 @@ func (c *NetworkAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operati if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NetworkAttachmentAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -43055,85 +42772,115 @@ func (c *NetworkAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type NetworkAttachmentsSetIamPolicyCall struct { - s *Service - project string - region string - resource string - regionsetpolicyrequest *RegionSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NetworkAttachmentsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkAttachmentAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +type NetworkAttachmentsDeleteCall struct { + s *Service + project string + region string + networkAttachment string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified NetworkAttachment in the given scope // +// - networkAttachment: Name of the NetworkAttachment resource to delete. // - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *NetworkAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NetworkAttachmentsSetIamPolicyCall { - c := &NetworkAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region of this request. +func (r *NetworkAttachmentsService) Delete(project string, region string, networkAttachment string) *NetworkAttachmentsDeleteCall { + c := &NetworkAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.regionsetpolicyrequest = regionsetpolicyrequest + c.networkAttachment = networkAttachment + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). end_interface: +// MixerMutationRequestBuilder +func (c *NetworkAttachmentsDeleteCall) RequestId(requestId string) *NetworkAttachmentsDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkAttachmentsSetIamPolicyCall { +func (c *NetworkAttachmentsDeleteCall) Fields(s ...googleapi.Field) *NetworkAttachmentsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsSetIamPolicyCall) Context(ctx context.Context) *NetworkAttachmentsSetIamPolicyCall { +func (c *NetworkAttachmentsDeleteCall) Context(ctx context.Context) *NetworkAttachmentsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsSetIamPolicyCall) Header() http.Header { +func (c *NetworkAttachmentsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *NetworkAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "networkAttachment": c.networkAttachment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.setIamPolicy" call. +// Do executes the "compute.networkAttachments.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *NetworkAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43152,7 +42899,7 @@ func (c *NetworkAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -43165,86 +42912,91 @@ func (c *NetworkAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type NetworkAttachmentsTestIamPermissionsCall struct { - s *Service - project string - region string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkAttachmentsGetCall struct { + s *Service + project string + region string + networkAttachment string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// Get: Returns the specified NetworkAttachment resource in the given scope. // +// - networkAttachment: Name of the NetworkAttachment resource to return. // - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *NetworkAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkAttachmentsTestIamPermissionsCall { - c := &NetworkAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region of this request. +func (r *NetworkAttachmentsService) Get(project string, region string, networkAttachment string) *NetworkAttachmentsGetCall { + c := &NetworkAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.networkAttachment = networkAttachment return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkAttachmentsTestIamPermissionsCall { +func (c *NetworkAttachmentsGetCall) Fields(s ...googleapi.Field) *NetworkAttachmentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkAttachmentsGetCall) IfNoneMatch(entityTag string) *NetworkAttachmentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *NetworkAttachmentsTestIamPermissionsCall { +func (c *NetworkAttachmentsGetCall) Context(ctx context.Context) *NetworkAttachmentsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkAttachmentsTestIamPermissionsCall) Header() http.Header { +func (c *NetworkAttachmentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err +func (c *NetworkAttachmentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "networkAttachment": c.networkAttachment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkAttachments.testIamPermissions" call. +// Do executes the "compute.networkAttachments.get" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *NetworkAttachment.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NetworkAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*NetworkAttachment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43263,7 +43015,7 @@ func (c *NetworkAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOpti if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &NetworkAttachment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -43276,129 +43028,42 @@ func (c *NetworkAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOpti return ret, nil } -type NetworkEdgeSecurityServicesAggregatedListCall struct { +type NetworkAttachmentsGetIamPolicyCall struct { s *Service project string + region string + resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves the list of all NetworkEdgeSecurityService -// resources available to the specified project. To prevent failure, Google -// recommends that you set the `returnPartialSuccess` parameter to `true`. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // -// - project: Name of the project scoping this request. -func (r *NetworkEdgeSecurityServicesService) AggregatedList(project string) *NetworkEdgeSecurityServicesAggregatedListCall { - c := &NetworkEdgeSecurityServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *NetworkAttachmentsService) GetIamPolicy(project string, region string, resource string) *NetworkAttachmentsGetIamPolicyCall { + c := &NetworkAttachmentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region + c.resource = resource return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) Filter(filter string) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkEdgeSecurityServicesAggregatedListCall) MaxResults(maxResults int64) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) OrderBy(orderBy string) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) PageToken(pageToken string) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkEdgeSecurityServicesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *NetworkAttachmentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NetworkAttachmentsGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesAggregatedListCall { +func (c *NetworkAttachmentsGetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkAttachmentsGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -43406,27 +43071,27 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) Fields(s ...googleapi.Fi // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEdgeSecurityServicesAggregatedListCall { +func (c *NetworkAttachmentsGetIamPolicyCall) IfNoneMatch(entityTag string) *NetworkAttachmentsGetIamPolicyCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesAggregatedListCall { +func (c *NetworkAttachmentsGetIamPolicyCall) Context(ctx context.Context) *NetworkAttachmentsGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) Header() http.Header { +func (c *NetworkAttachmentsGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkAttachmentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -43434,7 +43099,7 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (* var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEdgeSecurityServices") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -43442,18 +43107,19 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (* } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEdgeSecurityServices.aggregatedList" call. +// Do executes the "compute.networkAttachments.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkEdgeSecurityServiceAggregatedList.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEdgeSecurityServiceAggregatedList, error) { +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkAttachmentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43472,7 +43138,7 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkEdgeSecurityServiceAggregatedList{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -43485,48 +43151,26 @@ func (c *NetworkEdgeSecurityServicesAggregatedListCall) Do(opts ...googleapi.Cal return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NetworkEdgeSecurityServicesAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEdgeSecurityServiceAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NetworkEdgeSecurityServicesDeleteCall struct { - s *Service - project string - region string - networkEdgeSecurityService string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkAttachmentsInsertCall struct { + s *Service + project string + region string + networkattachment *NetworkAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified service. +// Insert: Creates a NetworkAttachment in the specified project in the given +// scope using the parameters that are included in the request. // -// - networkEdgeSecurityService: Name of the network edge security service to -// delete. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *NetworkEdgeSecurityServicesService) Delete(project string, region string, networkEdgeSecurityService string) *NetworkEdgeSecurityServicesDeleteCall { - c := &NetworkEdgeSecurityServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region of this request. +func (r *NetworkAttachmentsService) Insert(project string, region string, networkattachment *NetworkAttachment) *NetworkAttachmentsInsertCall { + c := &NetworkAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.networkEdgeSecurityService = networkEdgeSecurityService + c.networkattachment = networkattachment return c } @@ -43539,8 +43183,9 @@ func (r *NetworkEdgeSecurityServicesService) Delete(project string, region strin // request ID was received, and if so, will ignore the second request. This // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEdgeSecurityServicesDeleteCall) RequestId(requestId string) *NetworkEdgeSecurityServicesDeleteCall { +// supported ( 00000000-0000-0000-0000-000000000000). end_interface: +// MixerMutationRequestBuilder +func (c *NetworkAttachmentsInsertCall) RequestId(requestId string) *NetworkAttachmentsInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -43548,52 +43193,55 @@ func (c *NetworkEdgeSecurityServicesDeleteCall) RequestId(requestId string) *Net // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEdgeSecurityServicesDeleteCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesDeleteCall { +func (c *NetworkAttachmentsInsertCall) Fields(s ...googleapi.Field) *NetworkAttachmentsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEdgeSecurityServicesDeleteCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesDeleteCall { +func (c *NetworkAttachmentsInsertCall) Context(ctx context.Context) *NetworkAttachmentsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEdgeSecurityServicesDeleteCall) Header() http.Header { +func (c *NetworkAttachmentsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEdgeSecurityServicesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *NetworkAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "networkEdgeSecurityService": c.networkEdgeSecurityService, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEdgeSecurityServices.delete" call. +// Do executes the "compute.networkAttachments.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEdgeSecurityServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43625,35 +43273,109 @@ func (c *NetworkEdgeSecurityServicesDeleteCall) Do(opts ...googleapi.CallOption) return ret, nil } -type NetworkEdgeSecurityServicesGetCall struct { - s *Service - project string - region string - networkEdgeSecurityService string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkAttachmentsListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Gets a specified NetworkEdgeSecurityService. +// List: Lists the NetworkAttachments for a project in the given scope. // -// - networkEdgeSecurityService: Name of the network edge security service to -// get. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *NetworkEdgeSecurityServicesService) Get(project string, region string, networkEdgeSecurityService string) *NetworkEdgeSecurityServicesGetCall { - c := &NetworkEdgeSecurityServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region of this request. +func (r *NetworkAttachmentsService) List(project string, region string) *NetworkAttachmentsListCall { + c := &NetworkAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.networkEdgeSecurityService = networkEdgeSecurityService + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NetworkAttachmentsListCall) Filter(filter string) *NetworkAttachmentsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NetworkAttachmentsListCall) MaxResults(maxResults int64) *NetworkAttachmentsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NetworkAttachmentsListCall) OrderBy(orderBy string) *NetworkAttachmentsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NetworkAttachmentsListCall) PageToken(pageToken string) *NetworkAttachmentsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NetworkAttachmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkAttachmentsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEdgeSecurityServicesGetCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesGetCall { +func (c *NetworkAttachmentsListCall) Fields(s ...googleapi.Field) *NetworkAttachmentsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -43661,27 +43383,27 @@ func (c *NetworkEdgeSecurityServicesGetCall) Fields(s ...googleapi.Field) *Netwo // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkEdgeSecurityServicesGetCall) IfNoneMatch(entityTag string) *NetworkEdgeSecurityServicesGetCall { +func (c *NetworkAttachmentsListCall) IfNoneMatch(entityTag string) *NetworkAttachmentsListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEdgeSecurityServicesGetCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesGetCall { +func (c *NetworkAttachmentsListCall) Context(ctx context.Context) *NetworkAttachmentsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEdgeSecurityServicesGetCall) Header() http.Header { +func (c *NetworkAttachmentsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkAttachmentsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -43689,7 +43411,7 @@ func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Respon var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -43697,20 +43419,19 @@ func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Respon } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "networkEdgeSecurityService": c.networkEdgeSecurityService, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEdgeSecurityServices.get" call. +// Do executes the "compute.networkAttachments.list" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkEdgeSecurityService.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkEdgeSecurityServicesGetCall) Do(opts ...googleapi.CallOption) (*NetworkEdgeSecurityService, error) { +// *NetworkAttachmentList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NetworkAttachmentsListCall) Do(opts ...googleapi.CallOption) (*NetworkAttachmentList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43729,7 +43450,7 @@ func (c *NetworkEdgeSecurityServicesGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkEdgeSecurityService{ + ret := &NetworkAttachmentList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -43742,26 +43463,51 @@ func (c *NetworkEdgeSecurityServicesGetCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type NetworkEdgeSecurityServicesInsertCall struct { - s *Service - project string - region string - networkedgesecurityservice *NetworkEdgeSecurityService - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NetworkAttachmentsListCall) Pages(ctx context.Context, f func(*NetworkAttachmentList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Insert: Creates a new service in the specified project using the data -// included in the request. +type NetworkAttachmentsPatchCall struct { + s *Service + project string + region string + networkAttachment string + networkattachment *NetworkAttachment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Patches the specified NetworkAttachment resource with the data +// included in the request. This method supports PATCH semantics and uses JSON +// merge patch format and processing rules. // +// - networkAttachment: Name of the NetworkAttachment resource to patch. // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *NetworkEdgeSecurityServicesService) Insert(project string, region string, networkedgesecurityservice *NetworkEdgeSecurityService) *NetworkEdgeSecurityServicesInsertCall { - c := &NetworkEdgeSecurityServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *NetworkAttachmentsService) Patch(project string, region string, networkAttachment string, networkattachment *NetworkAttachment) *NetworkAttachmentsPatchCall { + c := &NetworkAttachmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.networkedgesecurityservice = networkedgesecurityservice + c.networkAttachment = networkAttachment + c.networkattachment = networkattachment return c } @@ -43774,71 +43520,66 @@ func (r *NetworkEdgeSecurityServicesService) Insert(project string, region strin // request ID was received, and if so, will ignore the second request. This // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEdgeSecurityServicesInsertCall) RequestId(requestId string) *NetworkEdgeSecurityServicesInsertCall { +// supported ( 00000000-0000-0000-0000-000000000000). end_interface: +// MixerMutationRequestBuilder +func (c *NetworkAttachmentsPatchCall) RequestId(requestId string) *NetworkAttachmentsPatchCall { c.urlParams_.Set("requestId", requestId) return c } -// ValidateOnly sets the optional parameter "validateOnly": If true, the -// request will not be committed. -func (c *NetworkEdgeSecurityServicesInsertCall) ValidateOnly(validateOnly bool) *NetworkEdgeSecurityServicesInsertCall { - c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEdgeSecurityServicesInsertCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesInsertCall { +func (c *NetworkAttachmentsPatchCall) Fields(s ...googleapi.Field) *NetworkAttachmentsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEdgeSecurityServicesInsertCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesInsertCall { +func (c *NetworkAttachmentsPatchCall) Context(ctx context.Context) *NetworkAttachmentsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEdgeSecurityServicesInsertCall) Header() http.Header { +func (c *NetworkAttachmentsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEdgeSecurityServicesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkAttachmentsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkattachment) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{networkAttachment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "networkAttachment": c.networkAttachment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEdgeSecurityServices.insert" call. +// Do executes the "compute.networkAttachments.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEdgeSecurityServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkAttachmentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43870,113 +43611,196 @@ func (c *NetworkEdgeSecurityServicesInsertCall) Do(opts ...googleapi.CallOption) return ret, nil } -type NetworkEdgeSecurityServicesPatchCall struct { - s *Service - project string - region string - networkEdgeSecurityService string - networkedgesecurityservice *NetworkEdgeSecurityService - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkAttachmentsSetIamPolicyCall struct { + s *Service + project string + region string + resource string + regionsetpolicyrequest *RegionSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Patches the specified policy with the data included in the request. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - networkEdgeSecurityService: Name of the network edge security service to -// update. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *NetworkEdgeSecurityServicesService) Patch(project string, region string, networkEdgeSecurityService string, networkedgesecurityservice *NetworkEdgeSecurityService) *NetworkEdgeSecurityServicesPatchCall { - c := &NetworkEdgeSecurityServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.networkEdgeSecurityService = networkEdgeSecurityService - c.networkedgesecurityservice = networkedgesecurityservice +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *NetworkAttachmentsService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NetworkAttachmentsSetIamPolicyCall { + c := &NetworkAttachmentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.resource = resource + c.regionsetpolicyrequest = regionsetpolicyrequest return c } -// Paths sets the optional parameter "paths": -func (c *NetworkEdgeSecurityServicesPatchCall) Paths(paths ...string) *NetworkEdgeSecurityServicesPatchCall { - c.urlParams_.SetMulti("paths", append([]string{}, paths...)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworkAttachmentsSetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkAttachmentsSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEdgeSecurityServicesPatchCall) RequestId(requestId string) *NetworkEdgeSecurityServicesPatchCall { - c.urlParams_.Set("requestId", requestId) +// Context sets the context to be used in this call's Do method. +func (c *NetworkAttachmentsSetIamPolicyCall) Context(ctx context.Context) *NetworkAttachmentsSetIamPolicyCall { + c.ctx_ = ctx return c } -// UpdateMask sets the optional parameter "updateMask": Indicates fields to be -// updated as part of this request. -func (c *NetworkEdgeSecurityServicesPatchCall) UpdateMask(updateMask string) *NetworkEdgeSecurityServicesPatchCall { - c.urlParams_.Set("updateMask", updateMask) +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NetworkAttachmentsSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NetworkAttachmentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/setIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.networkAttachments.setIamPolicy" call. +// Any non-2xx status code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkAttachmentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type NetworkAttachmentsTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. +// +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *NetworkAttachmentsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkAttachmentsTestIamPermissionsCall { + c := &NetworkAttachmentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEdgeSecurityServicesPatchCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesPatchCall { +func (c *NetworkAttachmentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkAttachmentsTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEdgeSecurityServicesPatchCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesPatchCall { +func (c *NetworkAttachmentsTestIamPermissionsCall) Context(ctx context.Context) *NetworkAttachmentsTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEdgeSecurityServicesPatchCall) Header() http.Header { +func (c *NetworkAttachmentsTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEdgeSecurityServicesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkAttachmentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkAttachments/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "networkEdgeSecurityService": c.networkEdgeSecurityService, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEdgeSecurityServices.patch" call. +// Do executes the "compute.networkAttachments.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEdgeSecurityServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkAttachmentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -43995,7 +43819,7 @@ func (c *NetworkEdgeSecurityServicesPatchCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -44008,7 +43832,7 @@ func (c *NetworkEdgeSecurityServicesPatchCall) Do(opts ...googleapi.CallOption) return ret, nil } -type NetworkEndpointGroupsAggregatedListCall struct { +type NetworkEdgeSecurityServicesAggregatedListCall struct { s *Service project string urlParams_ gensupport.URLParams @@ -44017,13 +43841,13 @@ type NetworkEndpointGroupsAggregatedListCall struct { header_ http.Header } -// AggregatedList: Retrieves the list of network endpoint groups and sorts them -// by zone. To prevent failure, Google recommends that you set the -// `returnPartialSuccess` parameter to `true`. +// AggregatedList: Retrieves the list of all NetworkEdgeSecurityService +// resources available to the specified project. To prevent failure, Google +// recommends that you set the `returnPartialSuccess` parameter to `true`. // -// - project: Project ID for this request. -func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall { - c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Name of the project scoping this request. +func (r *NetworkEdgeSecurityServicesService) AggregatedList(project string) *NetworkEdgeSecurityServicesAggregatedListCall { + c := &NetworkEdgeSecurityServicesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } @@ -44060,7 +43884,7 @@ func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEn // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) Filter(filter string) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("filter", filter) return c } @@ -44073,7 +43897,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *Network // which predate this field, if this flag is omitted or false, only scopes of // the scope types where the resource type is expected to be found will be // included. -func (c *NetworkEndpointGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) return c } @@ -44083,7 +43907,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) IncludeAllScopes(includeAllSco // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) MaxResults(maxResults int64) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -44096,7 +43920,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) * // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) OrderBy(orderBy string) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -44104,7 +43928,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *Netwo // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) PageToken(pageToken string) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -44114,7 +43938,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *N // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NetworkEndpointGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -44122,7 +43946,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) ReturnPartialSuccess(returnPar // ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The // Shared VPC service project id or service project number for which aggregated // list request is invoked for subnetworks list-usable api. -func (c *NetworkEndpointGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) return c } @@ -44130,7 +43954,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) ServiceProjectNumber(servicePr // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -44138,27 +43962,27 @@ func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) * // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEdgeSecurityServicesAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -44166,7 +43990,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.R var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEndpointGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEdgeSecurityServices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -44179,13 +44003,13 @@ func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.R return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.aggregatedList" call. +// Do executes the "compute.networkEdgeSecurityServices.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkEndpointGroupAggregatedList.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use +// *NetworkEdgeSecurityServiceAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEdgeSecurityServiceAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -44204,7 +44028,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkEndpointGroupAggregatedList{ + ret := &NetworkEdgeSecurityServiceAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -44220,7 +44044,7 @@ func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOptio // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error { +func (c *NetworkEdgeSecurityServicesAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEdgeSecurityServiceAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -44238,31 +44062,27 @@ func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f f } } -type NetworkEndpointGroupsAttachNetworkEndpointsCall struct { - s *Service - project string - zone string - networkEndpointGroup string - networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEdgeSecurityServicesDeleteCall struct { + s *Service + project string + region string + networkEdgeSecurityService string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AttachNetworkEndpoints: Attach a list of network endpoints to the specified -// network endpoint group. +// Delete: Deletes the specified service. // -// - networkEndpointGroup: The name of the network endpoint group where you are -// attaching network endpoints to. It should comply with RFC1035. +// - networkEdgeSecurityService: Name of the network edge security service to +// delete. // - project: Project ID for this request. -// - zone: The name of the zone where the network endpoint group is located. It -// should comply with RFC1035. -func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall { - c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region scoping this request. +func (r *NetworkEdgeSecurityServicesService) Delete(project string, region string, networkEdgeSecurityService string) *NetworkEdgeSecurityServicesDeleteCall { + c := &NetworkEdgeSecurityServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.networkEndpointGroup = networkEndpointGroup - c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest + c.region = region + c.networkEdgeSecurityService = networkEdgeSecurityService return c } @@ -44276,7 +44096,7 @@ func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zo // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall { +func (c *NetworkEdgeSecurityServicesDeleteCall) RequestId(requestId string) *NetworkEdgeSecurityServicesDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -44284,56 +44104,52 @@ func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId st // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall { +func (c *NetworkEdgeSecurityServicesDeleteCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall { +func (c *NetworkEdgeSecurityServicesDeleteCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header { +func (c *NetworkEdgeSecurityServicesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *NetworkEdgeSecurityServicesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "networkEndpointGroup": c.networkEndpointGroup, + "project": c.project, + "region": c.region, + "networkEdgeSecurityService": c.networkEdgeSecurityService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call. +// Do executes the "compute.networkEdgeSecurityServices.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkEdgeSecurityServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -44365,98 +44181,92 @@ func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.C return ret, nil } -type NetworkEndpointGroupsDeleteCall struct { - s *Service - project string - zone string - networkEndpointGroup string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEdgeSecurityServicesGetCall struct { + s *Service + project string + region string + networkEdgeSecurityService string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified network endpoint group. The network endpoints -// in the NEG and the VM instances they belong to are not terminated when the -// NEG is deleted. Note that the NEG cannot be deleted if there are backend -// services referencing it. +// Get: Gets a specified NetworkEdgeSecurityService. // -// - networkEndpointGroup: The name of the network endpoint group to delete. It -// should comply with RFC1035. +// - networkEdgeSecurityService: Name of the network edge security service to +// get. // - project: Project ID for this request. -// - zone: The name of the zone where the network endpoint group is located. It -// should comply with RFC1035. -func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall { - c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region scoping this request. +func (r *NetworkEdgeSecurityServicesService) Get(project string, region string, networkEdgeSecurityService string) *NetworkEdgeSecurityServicesGetCall { + c := &NetworkEdgeSecurityServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.networkEndpointGroup = networkEndpointGroup - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall { - c.urlParams_.Set("requestId", requestId) + c.region = region + c.networkEdgeSecurityService = networkEdgeSecurityService return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall { +func (c *NetworkEdgeSecurityServicesGetCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkEdgeSecurityServicesGetCall) IfNoneMatch(entityTag string) *NetworkEdgeSecurityServicesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall { +func (c *NetworkEdgeSecurityServicesGetCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header { +func (c *NetworkEdgeSecurityServicesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEdgeSecurityServicesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "networkEndpointGroup": c.networkEndpointGroup, + "project": c.project, + "region": c.region, + "networkEdgeSecurityService": c.networkEdgeSecurityService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.delete" call. +// Do executes the "compute.networkEdgeSecurityServices.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *NetworkEdgeSecurityService.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkEdgeSecurityServicesGetCall) Do(opts ...googleapi.CallOption) (*NetworkEdgeSecurityService, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -44475,7 +44285,7 @@ func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Ope if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NetworkEdgeSecurityService{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -44488,31 +44298,26 @@ func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type NetworkEndpointGroupsDetachNetworkEndpointsCall struct { - s *Service - project string - zone string - networkEndpointGroup string - networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEdgeSecurityServicesInsertCall struct { + s *Service + project string + region string + networkedgesecurityservice *NetworkEdgeSecurityService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// DetachNetworkEndpoints: Detach a list of network endpoints from the -// specified network endpoint group. +// Insert: Creates a new service in the specified project using the data +// included in the request. // -// - networkEndpointGroup: The name of the network endpoint group where you are -// removing network endpoints. It should comply with RFC1035. -// - project: Project ID for this request. -// - zone: The name of the zone where the network endpoint group is located. It -// should comply with RFC1035. -func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall { - c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *NetworkEdgeSecurityServicesService) Insert(project string, region string, networkedgesecurityservice *NetworkEdgeSecurityService) *NetworkEdgeSecurityServicesInsertCall { + c := &NetworkEdgeSecurityServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.networkEndpointGroup = networkEndpointGroup - c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest + c.region = region + c.networkedgesecurityservice = networkedgesecurityservice return c } @@ -44526,44 +44331,51 @@ func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zo // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall { +func (c *NetworkEdgeSecurityServicesInsertCall) RequestId(requestId string) *NetworkEdgeSecurityServicesInsertCall { c.urlParams_.Set("requestId", requestId) return c } +// ValidateOnly sets the optional parameter "validateOnly": If true, the +// request will not be committed. +func (c *NetworkEdgeSecurityServicesInsertCall) ValidateOnly(validateOnly bool) *NetworkEdgeSecurityServicesInsertCall { + c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall { +func (c *NetworkEdgeSecurityServicesInsertCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall { +func (c *NetworkEdgeSecurityServicesInsertCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header { +func (c *NetworkEdgeSecurityServicesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEdgeSecurityServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -44571,19 +44383,18 @@ func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "networkEndpointGroup": c.networkEndpointGroup, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call. +// Do executes the "compute.networkEdgeSecurityServices.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkEdgeSecurityServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -44615,215 +44426,113 @@ func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.C return ret, nil } -type NetworkEndpointGroupsGetCall struct { - s *Service - project string - zone string - networkEndpointGroup string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkEdgeSecurityServicesPatchCall struct { + s *Service + project string + region string + networkEdgeSecurityService string + networkedgesecurityservice *NetworkEdgeSecurityService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified network endpoint group. +// Patch: Patches the specified policy with the data included in the request. // -// - networkEndpointGroup: The name of the network endpoint group. It should -// comply with RFC1035. +// - networkEdgeSecurityService: Name of the network edge security service to +// update. // - project: Project ID for this request. -// - zone: The name of the zone where the network endpoint group is located. It -// should comply with RFC1035. -func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall { - c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region scoping this request. +func (r *NetworkEdgeSecurityServicesService) Patch(project string, region string, networkEdgeSecurityService string, networkedgesecurityservice *NetworkEdgeSecurityService) *NetworkEdgeSecurityServicesPatchCall { + c := &NetworkEdgeSecurityServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.networkEndpointGroup = networkEndpointGroup + c.region = region + c.networkEdgeSecurityService = networkEdgeSecurityService + c.networkedgesecurityservice = networkedgesecurityservice return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// Paths sets the optional parameter "paths": +func (c *NetworkEdgeSecurityServicesPatchCall) Paths(paths ...string) *NetworkEdgeSecurityServicesPatchCall { + c.urlParams_.SetMulti("paths", append([]string{}, paths...)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall { - c.ifNoneMatch_ = entityTag +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkEdgeSecurityServicesPatchCall) RequestId(requestId string) *NetworkEdgeSecurityServicesPatchCall { + c.urlParams_.Set("requestId", requestId) return c } -// Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *NetworkEndpointGroupsGetCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "networkEndpointGroup": c.networkEndpointGroup, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.networkEndpointGroups.get" call. -// Any non-2xx status code is an error. Response headers are in either -// *NetworkEndpointGroup.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &NetworkEndpointGroup{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type NetworkEndpointGroupsInsertCall struct { - s *Service - project string - zone string - networkendpointgroup *NetworkEndpointGroup - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a network endpoint group in the specified project using the -// parameters that are included in the request. -// -// - project: Project ID for this request. -// - zone: The name of the zone where you want to create the network endpoint -// group. It should comply with RFC1035. -func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall { - c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.zone = zone - c.networkendpointgroup = networkendpointgroup - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall { - c.urlParams_.Set("requestId", requestId) +// UpdateMask sets the optional parameter "updateMask": Indicates fields to be +// updated as part of this request. +func (c *NetworkEdgeSecurityServicesPatchCall) UpdateMask(updateMask string) *NetworkEdgeSecurityServicesPatchCall { + c.urlParams_.Set("updateMask", updateMask) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall { +func (c *NetworkEdgeSecurityServicesPatchCall) Fields(s ...googleapi.Field) *NetworkEdgeSecurityServicesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall { +func (c *NetworkEdgeSecurityServicesPatchCall) Context(ctx context.Context) *NetworkEdgeSecurityServicesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsInsertCall) Header() http.Header { +func (c *NetworkEdgeSecurityServicesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEdgeSecurityServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkedgesecurityservice) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/networkEdgeSecurityServices/{networkEdgeSecurityService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "region": c.region, + "networkEdgeSecurityService": c.networkEdgeSecurityService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.insert" call. +// Do executes the "compute.networkEdgeSecurityServices.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkEdgeSecurityServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -44855,26 +44564,23 @@ func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type NetworkEndpointGroupsListCall struct { +type NetworkEndpointGroupsAggregatedListCall struct { s *Service project string - zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves the list of network endpoint groups that are located in the -// specified project and zone. +// AggregatedList: Retrieves the list of network endpoint groups and sorts them +// by zone. To prevent failure, Google recommends that you set the +// `returnPartialSuccess` parameter to `true`. // -// - project: Project ID for this request. -// - zone: The name of the zone where the network endpoint group is located. It -// should comply with RFC1035. -func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall { - c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *NetworkEndpointGroupsService) AggregatedList(project string) *NetworkEndpointGroupsAggregatedListCall { + c := &NetworkEndpointGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone return c } @@ -44910,17 +44616,30 @@ func (r *NetworkEndpointGroupsService) List(project string, zone string) *Networ // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) Filter(filter string) *NetworkEndpointGroupsAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *NetworkEndpointGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NetworkEndpointGroupsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -44933,7 +44652,7 @@ func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEnd // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) OrderBy(orderBy string) *NetworkEndpointGroupsAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -44941,7 +44660,7 @@ func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpoint // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) PageToken(pageToken string) *NetworkEndpointGroupsAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -44951,15 +44670,23 @@ func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndp // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NetworkEndpointGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *NetworkEndpointGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NetworkEndpointGroupsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -44967,27 +44694,27 @@ func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEnd // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall { +func (c *NetworkEndpointGroupsAggregatedListCall) Context(ctx context.Context) *NetworkEndpointGroupsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsListCall) Header() http.Header { +func (c *NetworkEndpointGroupsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEndpointGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -44995,7 +44722,7 @@ func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, e var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -45004,18 +44731,17 @@ func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, e req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.list" call. +// Do executes the "compute.networkEndpointGroups.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkEndpointGroupList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *NetworkEndpointGroupAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) { +func (c *NetworkEndpointGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45034,7 +44760,7 @@ func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*Netwo if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkEndpointGroupList{ + ret := &NetworkEndpointGroupAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -45050,7 +44776,7 @@ func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*Netwo // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error { +func (c *NetworkEndpointGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -45068,146 +44794,82 @@ func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*Netwo } } -type NetworkEndpointGroupsListNetworkEndpointsCall struct { - s *Service - project string - zone string - networkEndpointGroup string - networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEndpointGroupsAttachNetworkEndpointsCall struct { + s *Service + project string + zone string + networkEndpointGroup string + networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListNetworkEndpoints: Lists the network endpoints in the specified network -// endpoint group. +// AttachNetworkEndpoints: Attach a list of network endpoints to the specified +// network endpoint group. // -// - networkEndpointGroup: The name of the network endpoint group from which -// you want to generate a list of included network endpoints. It should -// comply with RFC1035. +// - networkEndpointGroup: The name of the network endpoint group where you are +// attaching network endpoints to. It should comply with RFC1035. // - project: Project ID for this request. // - zone: The name of the zone where the network endpoint group is located. It // should comply with RFC1035. -func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall { - c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkEndpointGroupsService) AttachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsattachendpointsrequest *NetworkEndpointGroupsAttachEndpointsRequest) *NetworkEndpointGroupsAttachNetworkEndpointsCall { + c := &NetworkEndpointGroupsAttachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.networkEndpointGroup = networkEndpointGroup - c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest + c.networkendpointgroupsattachendpointsrequest = networkendpointgroupsattachendpointsrequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsListNetworkEndpointsCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsAttachNetworkEndpointsCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall { +func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsAttachNetworkEndpointsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall { +func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsAttachNetworkEndpointsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header { +func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsattachendpointsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -45222,13 +44884,12 @@ func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call. +// Do executes the "compute.networkEndpointGroups.attachNetworkEndpoints" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkEndpointGroupsAttachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45247,7 +44908,7 @@ func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkEndpointGroupsListNetworkEndpoints{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -45260,107 +44921,98 @@ func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.Cal return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NetworkEndpointGroupsTestIamPermissionsCall struct { - s *Service - project string - zone string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEndpointGroupsDeleteCall struct { + s *Service + project string + zone string + networkEndpointGroup string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// Delete: Deletes the specified network endpoint group. The network endpoints +// in the NEG and the VM instances they belong to are not terminated when the +// NEG is deleted. Note that the NEG cannot be deleted if there are backend +// services referencing it. // -// - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -// - zone: The name of the zone for this request. -func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall { - c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - networkEndpointGroup: The name of the network endpoint group to delete. It +// should comply with RFC1035. +// - project: Project ID for this request. +// - zone: The name of the zone where the network endpoint group is located. It +// should comply with RFC1035. +func (r *NetworkEndpointGroupsService) Delete(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsDeleteCall { + c := &NetworkEndpointGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.networkEndpointGroup = networkEndpointGroup + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkEndpointGroupsDeleteCall) RequestId(requestId string) *NetworkEndpointGroupsDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall { +func (c *NetworkEndpointGroupsDeleteCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall { +func (c *NetworkEndpointGroupsDeleteCall) Context(ctx context.Context) *NetworkEndpointGroupsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header { +func (c *NetworkEndpointGroupsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *NetworkEndpointGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "zone": c.zone, + "networkEndpointGroup": c.networkEndpointGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkEndpointGroups.testIamPermissions" call. +// Do executes the "compute.networkEndpointGroups.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkEndpointGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45379,7 +45031,7 @@ func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -45392,34 +45044,31 @@ func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallO return ret, nil } -type NetworkFirewallPoliciesAddAssociationCall struct { - s *Service - project string - firewallPolicy string - firewallpolicyassociation *FirewallPolicyAssociation - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEndpointGroupsDetachNetworkEndpointsCall struct { + s *Service + project string + zone string + networkEndpointGroup string + networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddAssociation: Inserts an association for the specified firewall policy. +// DetachNetworkEndpoints: Detach a list of network endpoints from the +// specified network endpoint group. // -// - firewallPolicy: Name of the firewall policy to update. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) AddAssociation(project string, firewallPolicy string, firewallpolicyassociation *FirewallPolicyAssociation) *NetworkFirewallPoliciesAddAssociationCall { - c := &NetworkFirewallPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - networkEndpointGroup: The name of the network endpoint group where you are +// removing network endpoints. It should comply with RFC1035. +// - project: Project ID for this request. +// - zone: The name of the zone where the network endpoint group is located. It +// should comply with RFC1035. +func (r *NetworkEndpointGroupsService) DetachNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupsdetachendpointsrequest *NetworkEndpointGroupsDetachEndpointsRequest) *NetworkEndpointGroupsDetachNetworkEndpointsCall { + c := &NetworkEndpointGroupsDetachNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy - c.firewallpolicyassociation = firewallpolicyassociation - return c -} - -// ReplaceExistingAssociation sets the optional parameter -// "replaceExistingAssociation": Indicates whether or not to replace it if an -// association of the attachment already exists. This is false by default, in -// which case an error will be returned if an association already exists. -func (c *NetworkFirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *NetworkFirewallPoliciesAddAssociationCall { - c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation)) + c.zone = zone + c.networkEndpointGroup = networkEndpointGroup + c.networkendpointgroupsdetachendpointsrequest = networkendpointgroupsdetachendpointsrequest return c } @@ -45433,7 +45082,7 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(r // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesAddAssociationCall) RequestId(requestId string) *NetworkFirewallPoliciesAddAssociationCall { +func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) RequestId(requestId string) *NetworkEndpointGroupsDetachNetworkEndpointsCall { c.urlParams_.Set("requestId", requestId) return c } @@ -45441,36 +45090,36 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) RequestId(requestId string) // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesAddAssociationCall { +func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsDetachNetworkEndpointsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesAddAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesAddAssociationCall { +func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsDetachNetworkEndpointsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesAddAssociationCall) Header() http.Header { +func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupsdetachendpointsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/addAssociation") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -45478,18 +45127,19 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, + "zone": c.zone, + "networkEndpointGroup": c.networkEndpointGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.addAssociation" call. +// Do executes the "compute.networkEndpointGroups.detachNetworkEndpoints" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkEndpointGroupsDetachNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45521,111 +45171,93 @@ func (c *NetworkFirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOpt return ret, nil } -type NetworkFirewallPoliciesAddRuleCall struct { - s *Service - project string - firewallPolicy string - firewallpolicyrule *FirewallPolicyRule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEndpointGroupsGetCall struct { + s *Service + project string + zone string + networkEndpointGroup string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// AddRule: Inserts a rule into a firewall policy. +// Get: Returns the specified network endpoint group. // -// - firewallPolicy: Name of the firewall policy to update. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) AddRule(project string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *NetworkFirewallPoliciesAddRuleCall { - c := &NetworkFirewallPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - networkEndpointGroup: The name of the network endpoint group. It should +// comply with RFC1035. +// - project: Project ID for this request. +// - zone: The name of the zone where the network endpoint group is located. It +// should comply with RFC1035. +func (r *NetworkEndpointGroupsService) Get(project string, zone string, networkEndpointGroup string) *NetworkEndpointGroupsGetCall { + c := &NetworkEndpointGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy - c.firewallpolicyrule = firewallpolicyrule - return c -} - -// MaxPriority sets the optional parameter "maxPriority": When rule.priority is -// not specified, auto choose a unused priority between minPriority and -// maxPriority>. This field is exclusive with rule.priority. -func (c *NetworkFirewallPoliciesAddRuleCall) MaxPriority(maxPriority int64) *NetworkFirewallPoliciesAddRuleCall { - c.urlParams_.Set("maxPriority", fmt.Sprint(maxPriority)) - return c -} - -// MinPriority sets the optional parameter "minPriority": When rule.priority is -// not specified, auto choose a unused priority between minPriority and -// maxPriority>. This field is exclusive with rule.priority. -func (c *NetworkFirewallPoliciesAddRuleCall) MinPriority(minPriority int64) *NetworkFirewallPoliciesAddRuleCall { - c.urlParams_.Set("minPriority", fmt.Sprint(minPriority)) - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesAddRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesAddRuleCall { - c.urlParams_.Set("requestId", requestId) + c.zone = zone + c.networkEndpointGroup = networkEndpointGroup return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesAddRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesAddRuleCall { +func (c *NetworkEndpointGroupsGetCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkEndpointGroupsGetCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesAddRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesAddRuleCall { +func (c *NetworkEndpointGroupsGetCall) Context(ctx context.Context) *NetworkEndpointGroupsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesAddRuleCall) Header() http.Header { +func (c *NetworkEndpointGroupsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) - if err != nil { - return nil, err +func (c *NetworkEndpointGroupsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/addRule") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, + "zone": c.zone, + "networkEndpointGroup": c.networkEndpointGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.addRule" call. +// Do executes the "compute.networkEndpointGroups.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *NetworkEndpointGroup.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NetworkEndpointGroupsGetCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroup, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45644,7 +45276,7 @@ func (c *NetworkFirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NetworkEndpointGroup{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -45657,23 +45289,27 @@ func (c *NetworkFirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type NetworkFirewallPoliciesCloneRulesCall struct { - s *Service - project string - firewallPolicy string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEndpointGroupsInsertCall struct { + s *Service + project string + zone string + networkendpointgroup *NetworkEndpointGroup + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// CloneRules: Copies rules to the specified firewall policy. +// Insert: Creates a network endpoint group in the specified project using the +// parameters that are included in the request. // -// - firewallPolicy: Name of the firewall policy to update. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) CloneRules(project string, firewallPolicy string) *NetworkFirewallPoliciesCloneRulesCall { - c := &NetworkFirewallPoliciesCloneRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - zone: The name of the zone where you want to create the network endpoint +// group. It should comply with RFC1035. +func (r *NetworkEndpointGroupsService) Insert(project string, zone string, networkendpointgroup *NetworkEndpointGroup) *NetworkEndpointGroupsInsertCall { + c := &NetworkEndpointGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy + c.zone = zone + c.networkendpointgroup = networkendpointgroup return c } @@ -45687,47 +45323,44 @@ func (r *NetworkFirewallPoliciesService) CloneRules(project string, firewallPoli // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesCloneRulesCall) RequestId(requestId string) *NetworkFirewallPoliciesCloneRulesCall { +func (c *NetworkEndpointGroupsInsertCall) RequestId(requestId string) *NetworkEndpointGroupsInsertCall { c.urlParams_.Set("requestId", requestId) return c } -// SourceFirewallPolicy sets the optional parameter "sourceFirewallPolicy": The -// firewall policy from which to copy rules. -func (c *NetworkFirewallPoliciesCloneRulesCall) SourceFirewallPolicy(sourceFirewallPolicy string) *NetworkFirewallPoliciesCloneRulesCall { - c.urlParams_.Set("sourceFirewallPolicy", sourceFirewallPolicy) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesCloneRulesCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesCloneRulesCall { +func (c *NetworkEndpointGroupsInsertCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesCloneRulesCall) Context(ctx context.Context) *NetworkFirewallPoliciesCloneRulesCall { +func (c *NetworkEndpointGroupsInsertCall) Context(ctx context.Context) *NetworkEndpointGroupsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesCloneRulesCall) Header() http.Header { +func (c *NetworkEndpointGroupsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *NetworkEndpointGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroup) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -45735,18 +45368,18 @@ func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.cloneRules" call. +// Do executes the "compute.networkEndpointGroups.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkEndpointGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45778,89 +45411,167 @@ func (c *NetworkFirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) return ret, nil } -type NetworkFirewallPoliciesDeleteCall struct { - s *Service - project string - firewallPolicy string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkEndpointGroupsListCall struct { + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified policy. +// List: Retrieves the list of network endpoint groups that are located in the +// specified project and zone. // -// - firewallPolicy: Name of the firewall policy to delete. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) Delete(project string, firewallPolicy string) *NetworkFirewallPoliciesDeleteCall { - c := &NetworkFirewallPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - zone: The name of the zone where the network endpoint group is located. It +// should comply with RFC1035. +func (r *NetworkEndpointGroupsService) List(project string, zone string) *NetworkEndpointGroupsListCall { + c := &NetworkEndpointGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesDeleteCall) RequestId(requestId string) *NetworkFirewallPoliciesDeleteCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NetworkFirewallPoliciesDeleteCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesDeleteCall) Context(ctx context.Context) *NetworkFirewallPoliciesDeleteCall { - c.ctx_ = ctx + c.zone = zone return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *NetworkFirewallPoliciesDeleteCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NetworkEndpointGroupsListCall) Filter(filter string) *NetworkEndpointGroupsListCall { + c.urlParams_.Set("filter", filter) + return c } -func (c *NetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NetworkEndpointGroupsListCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NetworkEndpointGroupsListCall) OrderBy(orderBy string) *NetworkEndpointGroupsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NetworkEndpointGroupsListCall) PageToken(pageToken string) *NetworkEndpointGroupsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NetworkEndpointGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworkEndpointGroupsListCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkEndpointGroupsListCall) IfNoneMatch(entityTag string) *NetworkEndpointGroupsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *NetworkEndpointGroupsListCall) Context(ctx context.Context) *NetworkEndpointGroupsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NetworkEndpointGroupsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NetworkEndpointGroupsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.delete" call. +// Do executes the "compute.networkEndpointGroups.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *NetworkEndpointGroupList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkEndpointGroupsListCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45879,7 +45590,7 @@ func (c *NetworkFirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NetworkEndpointGroupList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -45892,86 +45603,320 @@ func (c *NetworkFirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type NetworkFirewallPoliciesGetCall struct { - s *Service - project string - firewallPolicy string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NetworkEndpointGroupsListCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Get: Returns the specified network firewall policy. +type NetworkEndpointGroupsListNetworkEndpointsCall struct { + s *Service + project string + zone string + networkEndpointGroup string + networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ListNetworkEndpoints: Lists the network endpoints in the specified network +// endpoint group. // -// - firewallPolicy: Name of the firewall policy to get. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) Get(project string, firewallPolicy string) *NetworkFirewallPoliciesGetCall { - c := &NetworkFirewallPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - networkEndpointGroup: The name of the network endpoint group from which +// you want to generate a list of included network endpoints. It should +// comply with RFC1035. +// - project: Project ID for this request. +// - zone: The name of the zone where the network endpoint group is located. It +// should comply with RFC1035. +func (r *NetworkEndpointGroupsService) ListNetworkEndpoints(project string, zone string, networkEndpointGroup string, networkendpointgroupslistendpointsrequest *NetworkEndpointGroupsListEndpointsRequest) *NetworkEndpointGroupsListNetworkEndpointsCall { + c := &NetworkEndpointGroupsListNetworkEndpointsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy + c.zone = zone + c.networkEndpointGroup = networkEndpointGroup + c.networkendpointgroupslistendpointsrequest = networkendpointgroupslistendpointsrequest + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Filter(filter string) *NetworkEndpointGroupsListNetworkEndpointsCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) MaxResults(maxResults int64) *NetworkEndpointGroupsListNetworkEndpointsCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) OrderBy(orderBy string) *NetworkEndpointGroupsListNetworkEndpointsCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) PageToken(pageToken string) *NetworkEndpointGroupsListNetworkEndpointsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkEndpointGroupsListNetworkEndpointsCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesGetCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetCall { +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsListNetworkEndpointsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworkFirewallPoliciesGetCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetCall { - c.ifNoneMatch_ = entityTag +// Context sets the context to be used in this call's Do method. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Context(ctx context.Context) *NetworkEndpointGroupsListNetworkEndpointsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networkendpointgroupslistendpointsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "networkEndpointGroup": c.networkEndpointGroup, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.networkEndpointGroups.listNetworkEndpoints" call. +// Any non-2xx status code is an error. Response headers are in either +// *NetworkEndpointGroupsListNetworkEndpoints.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Do(opts ...googleapi.CallOption) (*NetworkEndpointGroupsListNetworkEndpoints, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &NetworkEndpointGroupsListNetworkEndpoints{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NetworkEndpointGroupsListNetworkEndpointsCall) Pages(ctx context.Context, f func(*NetworkEndpointGroupsListNetworkEndpoints) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type NetworkEndpointGroupsTestIamPermissionsCall struct { + s *Service + project string + zone string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. +// +// - project: Project ID for this request. +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *NetworkEndpointGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkEndpointGroupsTestIamPermissionsCall { + c := &NetworkEndpointGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworkEndpointGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkEndpointGroupsTestIamPermissionsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesGetCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetCall { +func (c *NetworkEndpointGroupsTestIamPermissionsCall) Context(ctx context.Context) *NetworkEndpointGroupsTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesGetCall) Header() http.Header { +func (c *NetworkEndpointGroupsTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NetworkEndpointGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.get" call. +// Do executes the "compute.networkEndpointGroups.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *FirewallPolicy.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*FirewallPolicy, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkEndpointGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -45990,7 +45935,7 @@ func (c *NetworkFirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*Fire if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FirewallPolicy{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46003,77 +45948,87 @@ func (c *NetworkFirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*Fire return ret, nil } -type NetworkFirewallPoliciesGetAssociationCall struct { - s *Service - project string - firewallPolicy string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesAddAssociationCall struct { + s *Service + project string + firewallPolicy string + firewallpolicyassociation *FirewallPolicyAssociation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetAssociation: Gets an association with the specified name. +// AddAssociation: Inserts an association for the specified firewall policy. // -// - firewallPolicy: Name of the firewall policy to which the queried -// association belongs. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) GetAssociation(project string, firewallPolicy string) *NetworkFirewallPoliciesGetAssociationCall { - c := &NetworkFirewallPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - firewallPolicy: Name of the firewall policy to update. +// - project: Project ID for this request. +func (r *NetworkFirewallPoliciesService) AddAssociation(project string, firewallPolicy string, firewallpolicyassociation *FirewallPolicyAssociation) *NetworkFirewallPoliciesAddAssociationCall { + c := &NetworkFirewallPoliciesAddAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewallPolicy = firewallPolicy + c.firewallpolicyassociation = firewallpolicyassociation return c } -// Name sets the optional parameter "name": The name of the association to get -// from the firewall policy. -func (c *NetworkFirewallPoliciesGetAssociationCall) Name(name string) *NetworkFirewallPoliciesGetAssociationCall { - c.urlParams_.Set("name", name) +// ReplaceExistingAssociation sets the optional parameter +// "replaceExistingAssociation": Indicates whether or not to replace it if an +// association of the attachment already exists. This is false by default, in +// which case an error will be returned if an association already exists. +func (c *NetworkFirewallPoliciesAddAssociationCall) ReplaceExistingAssociation(replaceExistingAssociation bool) *NetworkFirewallPoliciesAddAssociationCall { + c.urlParams_.Set("replaceExistingAssociation", fmt.Sprint(replaceExistingAssociation)) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkFirewallPoliciesAddAssociationCall) RequestId(requestId string) *NetworkFirewallPoliciesAddAssociationCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetAssociationCall { +func (c *NetworkFirewallPoliciesAddAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesAddAssociationCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworkFirewallPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetAssociationCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesGetAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetAssociationCall { +func (c *NetworkFirewallPoliciesAddAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesAddAssociationCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesGetAssociationCall) Header() http.Header { +func (c *NetworkFirewallPoliciesAddAssociationCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NetworkFirewallPoliciesAddAssociationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyassociation) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/addAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -46085,13 +46040,12 @@ func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.getAssociation" call. +// Do executes the "compute.networkFirewallPolicies.addAssociation" call. // Any non-2xx status code is an error. Response headers are in either -// *FirewallPolicyAssociation.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyAssociation, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesAddAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46110,7 +46064,7 @@ func (c *NetworkFirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FirewallPolicyAssociation{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46123,94 +46077,111 @@ func (c *NetworkFirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOpt return ret, nil } -type NetworkFirewallPoliciesGetIamPolicyCall struct { - s *Service - project string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesAddRuleCall struct { + s *Service + project string + firewallPolicy string + firewallpolicyrule *FirewallPolicyRule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// AddRule: Inserts a rule into a firewall policy. // +// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *NetworkFirewallPoliciesService) GetIamPolicy(project string, resource string) *NetworkFirewallPoliciesGetIamPolicyCall { - c := &NetworkFirewallPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) AddRule(project string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *NetworkFirewallPoliciesAddRuleCall { + c := &NetworkFirewallPoliciesAddRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource + c.firewallPolicy = firewallPolicy + c.firewallpolicyrule = firewallpolicyrule return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *NetworkFirewallPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NetworkFirewallPoliciesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// MaxPriority sets the optional parameter "maxPriority": When rule.priority is +// not specified, auto choose a unused priority between minPriority and +// maxPriority>. This field is exclusive with rule.priority. +func (c *NetworkFirewallPoliciesAddRuleCall) MaxPriority(maxPriority int64) *NetworkFirewallPoliciesAddRuleCall { + c.urlParams_.Set("maxPriority", fmt.Sprint(maxPriority)) + return c +} + +// MinPriority sets the optional parameter "minPriority": When rule.priority is +// not specified, auto choose a unused priority between minPriority and +// maxPriority>. This field is exclusive with rule.priority. +func (c *NetworkFirewallPoliciesAddRuleCall) MinPriority(minPriority int64) *NetworkFirewallPoliciesAddRuleCall { + c.urlParams_.Set("minPriority", fmt.Sprint(minPriority)) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkFirewallPoliciesAddRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesAddRuleCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetIamPolicyCall { +func (c *NetworkFirewallPoliciesAddRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesAddRuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworkFirewallPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesGetIamPolicyCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetIamPolicyCall { +func (c *NetworkFirewallPoliciesAddRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesAddRuleCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesGetIamPolicyCall) Header() http.Header { +func (c *NetworkFirewallPoliciesAddRuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NetworkFirewallPoliciesAddRuleCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/addRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.getIamPolicy" call. +// Do executes the "compute.networkFirewallPolicies.addRule" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *NetworkFirewallPoliciesAddRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46229,7 +46200,7 @@ func (c *NetworkFirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46242,77 +46213,79 @@ func (c *NetworkFirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOptio return ret, nil } -type NetworkFirewallPoliciesGetRuleCall struct { +type NetworkFirewallPoliciesCloneRulesCall struct { s *Service project string firewallPolicy string urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetRule: Gets a rule of the specified priority. +// CloneRules: Copies rules to the specified firewall policy. // -// - firewallPolicy: Name of the firewall policy to which the queried rule -// belongs. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) GetRule(project string, firewallPolicy string) *NetworkFirewallPoliciesGetRuleCall { - c := &NetworkFirewallPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - firewallPolicy: Name of the firewall policy to update. +// - project: Project ID for this request. +func (r *NetworkFirewallPoliciesService) CloneRules(project string, firewallPolicy string) *NetworkFirewallPoliciesCloneRulesCall { + c := &NetworkFirewallPoliciesCloneRulesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewallPolicy = firewallPolicy return c } -// Priority sets the optional parameter "priority": The priority of the rule to -// get from the firewall policy. -func (c *NetworkFirewallPoliciesGetRuleCall) Priority(priority int64) *NetworkFirewallPoliciesGetRuleCall { - c.urlParams_.Set("priority", fmt.Sprint(priority)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkFirewallPoliciesCloneRulesCall) RequestId(requestId string) *NetworkFirewallPoliciesCloneRulesCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// SourceFirewallPolicy sets the optional parameter "sourceFirewallPolicy": The +// firewall policy from which to copy rules. +func (c *NetworkFirewallPoliciesCloneRulesCall) SourceFirewallPolicy(sourceFirewallPolicy string) *NetworkFirewallPoliciesCloneRulesCall { + c.urlParams_.Set("sourceFirewallPolicy", sourceFirewallPolicy) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesGetRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetRuleCall { +func (c *NetworkFirewallPoliciesCloneRulesCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesCloneRulesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworkFirewallPoliciesGetRuleCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetRuleCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesGetRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetRuleCall { +func (c *NetworkFirewallPoliciesCloneRulesCall) Context(ctx context.Context) *NetworkFirewallPoliciesCloneRulesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesGetRuleCall) Header() http.Header { +func (c *NetworkFirewallPoliciesCloneRulesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesCloneRulesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/cloneRules") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -46324,13 +46297,12 @@ func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.getRule" call. +// Do executes the "compute.networkFirewallPolicies.cloneRules" call. // Any non-2xx status code is an error. Response headers are in either -// *FirewallPolicyRule.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NetworkFirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyRule, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesCloneRulesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46349,7 +46321,7 @@ func (c *NetworkFirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FirewallPolicyRule{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46362,23 +46334,23 @@ func (c *NetworkFirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type NetworkFirewallPoliciesInsertCall struct { +type NetworkFirewallPoliciesDeleteCall struct { s *Service project string - firewallpolicy *FirewallPolicy + firewallPolicy string urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Insert: Creates a new policy in the specified project using the data -// included in the request. +// Delete: Deletes the specified policy. // +// - firewallPolicy: Name of the firewall policy to delete. // - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) Insert(project string, firewallpolicy *FirewallPolicy) *NetworkFirewallPoliciesInsertCall { - c := &NetworkFirewallPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) Delete(project string, firewallPolicy string) *NetworkFirewallPoliciesDeleteCall { + c := &NetworkFirewallPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallpolicy = firewallpolicy + c.firewallPolicy = firewallPolicy return c } @@ -46392,7 +46364,7 @@ func (r *NetworkFirewallPoliciesService) Insert(project string, firewallpolicy * // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesInsertCall) RequestId(requestId string) *NetworkFirewallPoliciesInsertCall { +func (c *NetworkFirewallPoliciesDeleteCall) RequestId(requestId string) *NetworkFirewallPoliciesDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -46400,54 +46372,51 @@ func (c *NetworkFirewallPoliciesInsertCall) RequestId(requestId string) *Network // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesInsertCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesInsertCall { +func (c *NetworkFirewallPoliciesDeleteCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesInsertCall) Context(ctx context.Context) *NetworkFirewallPoliciesInsertCall { +func (c *NetworkFirewallPoliciesDeleteCall) Context(ctx context.Context) *NetworkFirewallPoliciesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesInsertCall) Header() http.Header { +func (c *NetworkFirewallPoliciesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *NetworkFirewallPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.insert" call. +// Do executes the "compute.networkFirewallPolicies.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkFirewallPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46479,107 +46448,31 @@ func (c *NetworkFirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type NetworkFirewallPoliciesListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesGetCall struct { + s *Service + project string + firewallPolicy string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// List: Lists all the policies that have been configured for the specified -// project. +// Get: Returns the specified network firewall policy. // +// - firewallPolicy: Name of the firewall policy to get. // - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) List(project string) *NetworkFirewallPoliciesListCall { - c := &NetworkFirewallPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) Get(project string, firewallPolicy string) *NetworkFirewallPoliciesGetCall { + c := &NetworkFirewallPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NetworkFirewallPoliciesListCall) Filter(filter string) *NetworkFirewallPoliciesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworkFirewallPoliciesListCall) MaxResults(maxResults int64) *NetworkFirewallPoliciesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworkFirewallPoliciesListCall) OrderBy(orderBy string) *NetworkFirewallPoliciesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NetworkFirewallPoliciesListCall) PageToken(pageToken string) *NetworkFirewallPoliciesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NetworkFirewallPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkFirewallPoliciesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + c.firewallPolicy = firewallPolicy return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesListCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesListCall { +func (c *NetworkFirewallPoliciesGetCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -46587,27 +46480,27 @@ func (c *NetworkFirewallPoliciesListCall) Fields(s ...googleapi.Field) *NetworkF // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworkFirewallPoliciesListCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesListCall { +func (c *NetworkFirewallPoliciesGetCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesListCall) Context(ctx context.Context) *NetworkFirewallPoliciesListCall { +func (c *NetworkFirewallPoliciesGetCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesListCall) Header() http.Header { +func (c *NetworkFirewallPoliciesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -46615,7 +46508,7 @@ func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -46623,18 +46516,18 @@ func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.list" call. +// Do executes the "compute.networkFirewallPolicies.get" call. // Any non-2xx status code is an error. Response headers are in either -// *FirewallPolicyList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NetworkFirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyList, error) { +// *FirewallPolicy.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesGetCall) Do(opts ...googleapi.CallOption) (*FirewallPolicy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46653,7 +46546,7 @@ func (c *NetworkFirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*Fir if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &FirewallPolicyList{ + ret := &FirewallPolicy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46666,99 +46559,77 @@ func (c *NetworkFirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*Fir return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NetworkFirewallPoliciesListCall) Pages(ctx context.Context, f func(*FirewallPolicyList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NetworkFirewallPoliciesPatchCall struct { +type NetworkFirewallPoliciesGetAssociationCall struct { s *Service project string firewallPolicy string - firewallpolicy *FirewallPolicy urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Patch: Patches the specified policy with the data included in the request. +// GetAssociation: Gets an association with the specified name. // -// - firewallPolicy: Name of the firewall policy to update. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) Patch(project string, firewallPolicy string, firewallpolicy *FirewallPolicy) *NetworkFirewallPoliciesPatchCall { - c := &NetworkFirewallPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - firewallPolicy: Name of the firewall policy to which the queried +// association belongs. +// - project: Project ID for this request. +func (r *NetworkFirewallPoliciesService) GetAssociation(project string, firewallPolicy string) *NetworkFirewallPoliciesGetAssociationCall { + c := &NetworkFirewallPoliciesGetAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewallPolicy = firewallPolicy - c.firewallpolicy = firewallpolicy return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesPatchCall) RequestId(requestId string) *NetworkFirewallPoliciesPatchCall { - c.urlParams_.Set("requestId", requestId) +// Name sets the optional parameter "name": The name of the association to get +// from the firewall policy. +func (c *NetworkFirewallPoliciesGetAssociationCall) Name(name string) *NetworkFirewallPoliciesGetAssociationCall { + c.urlParams_.Set("name", name) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesPatchCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesPatchCall { +func (c *NetworkFirewallPoliciesGetAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetAssociationCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkFirewallPoliciesGetAssociationCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetAssociationCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesPatchCall) Context(ctx context.Context) *NetworkFirewallPoliciesPatchCall { +func (c *NetworkFirewallPoliciesGetAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetAssociationCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesPatchCall) Header() http.Header { +func (c *NetworkFirewallPoliciesGetAssociationCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) - if err != nil { - return nil, err +func (c *NetworkFirewallPoliciesGetAssociationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -46770,12 +46641,13 @@ func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.patch" call. +// Do executes the "compute.networkFirewallPolicies.getAssociation" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *FirewallPolicyAssociation.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesGetAssociationCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyAssociation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46794,7 +46666,7 @@ func (c *NetworkFirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &FirewallPolicyAssociation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46807,102 +46679,94 @@ func (c *NetworkFirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type NetworkFirewallPoliciesPatchRuleCall struct { - s *Service - project string - firewallPolicy string - firewallpolicyrule *FirewallPolicyRule - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesGetIamPolicyCall struct { + s *Service + project string + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// PatchRule: Patches a rule of the specified priority. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // -// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) PatchRule(project string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *NetworkFirewallPoliciesPatchRuleCall { - c := &NetworkFirewallPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *NetworkFirewallPoliciesService) GetIamPolicy(project string, resource string) *NetworkFirewallPoliciesGetIamPolicyCall { + c := &NetworkFirewallPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy - c.firewallpolicyrule = firewallpolicyrule - return c -} - -// Priority sets the optional parameter "priority": The priority of the rule to -// patch. -func (c *NetworkFirewallPoliciesPatchRuleCall) Priority(priority int64) *NetworkFirewallPoliciesPatchRuleCall { - c.urlParams_.Set("priority", fmt.Sprint(priority)) + c.resource = resource return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesPatchRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesPatchRuleCall { - c.urlParams_.Set("requestId", requestId) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *NetworkFirewallPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NetworkFirewallPoliciesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesPatchRuleCall { +func (c *NetworkFirewallPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkFirewallPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesPatchRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesPatchRuleCall { +func (c *NetworkFirewallPoliciesGetIamPolicyCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesPatchRuleCall) Header() http.Header { +func (c *NetworkFirewallPoliciesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) - if err != nil { - return nil, err +func (c *NetworkFirewallPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/patchRule") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.patchRule" call. +// Do executes the "compute.networkFirewallPolicies.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkFirewallPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -46921,7 +46785,7 @@ func (c *NetworkFirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -46934,79 +46798,77 @@ func (c *NetworkFirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) return ret, nil } -type NetworkFirewallPoliciesRemoveAssociationCall struct { +type NetworkFirewallPoliciesGetRuleCall struct { s *Service project string firewallPolicy string urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// RemoveAssociation: Removes an association for the specified firewall policy. +// GetRule: Gets a rule of the specified priority. // -// - firewallPolicy: Name of the firewall policy to update. -// - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) RemoveAssociation(project string, firewallPolicy string) *NetworkFirewallPoliciesRemoveAssociationCall { - c := &NetworkFirewallPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - firewallPolicy: Name of the firewall policy to which the queried rule +// belongs. +// - project: Project ID for this request. +func (r *NetworkFirewallPoliciesService) GetRule(project string, firewallPolicy string) *NetworkFirewallPoliciesGetRuleCall { + c := &NetworkFirewallPoliciesGetRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewallPolicy = firewallPolicy return c } -// Name sets the optional parameter "name": Name for the attachment that will -// be removed. -func (c *NetworkFirewallPoliciesRemoveAssociationCall) Name(name string) *NetworkFirewallPoliciesRemoveAssociationCall { - c.urlParams_.Set("name", name) - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesRemoveAssociationCall) RequestId(requestId string) *NetworkFirewallPoliciesRemoveAssociationCall { - c.urlParams_.Set("requestId", requestId) +// Priority sets the optional parameter "priority": The priority of the rule to +// get from the firewall policy. +func (c *NetworkFirewallPoliciesGetRuleCall) Priority(priority int64) *NetworkFirewallPoliciesGetRuleCall { + c.urlParams_.Set("priority", fmt.Sprint(priority)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesRemoveAssociationCall { +func (c *NetworkFirewallPoliciesGetRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesGetRuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkFirewallPoliciesGetRuleCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesGetRuleCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesRemoveAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesRemoveAssociationCall { +func (c *NetworkFirewallPoliciesGetRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesGetRuleCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header { +func (c *NetworkFirewallPoliciesGetRuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesGetRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/getRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -47018,12 +46880,13 @@ func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*h return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.removeAssociation" call. +// Do executes the "compute.networkFirewallPolicies.getRule" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *FirewallPolicyRule.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NetworkFirewallPoliciesGetRuleCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyRule, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47042,7 +46905,7 @@ func (c *NetworkFirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.Call if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &FirewallPolicyRule{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -47055,30 +46918,23 @@ func (c *NetworkFirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.Call return ret, nil } -type NetworkFirewallPoliciesRemoveRuleCall struct { +type NetworkFirewallPoliciesInsertCall struct { s *Service project string - firewallPolicy string + firewallpolicy *FirewallPolicy urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// RemoveRule: Deletes a rule of the specified priority. +// Insert: Creates a new policy in the specified project using the data +// included in the request. // -// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -func (r *NetworkFirewallPoliciesService) RemoveRule(project string, firewallPolicy string) *NetworkFirewallPoliciesRemoveRuleCall { - c := &NetworkFirewallPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) Insert(project string, firewallpolicy *FirewallPolicy) *NetworkFirewallPoliciesInsertCall { + c := &NetworkFirewallPoliciesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.firewallPolicy = firewallPolicy - return c -} - -// Priority sets the optional parameter "priority": The priority of the rule to -// remove from the firewall policy. -func (c *NetworkFirewallPoliciesRemoveRuleCall) Priority(priority int64) *NetworkFirewallPoliciesRemoveRuleCall { - c.urlParams_.Set("priority", fmt.Sprint(priority)) + c.firewallpolicy = firewallpolicy return c } @@ -47092,7 +46948,7 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) Priority(priority int64) *Networ // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworkFirewallPoliciesRemoveRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesRemoveRuleCall { +func (c *NetworkFirewallPoliciesInsertCall) RequestId(requestId string) *NetworkFirewallPoliciesInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -47100,32 +46956,36 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) RequestId(requestId string) *Net // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesRemoveRuleCall { +func (c *NetworkFirewallPoliciesInsertCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesRemoveRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesRemoveRuleCall { +func (c *NetworkFirewallPoliciesInsertCall) Context(ctx context.Context) *NetworkFirewallPoliciesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { +func (c *NetworkFirewallPoliciesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } - -func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + +func (c *NetworkFirewallPoliciesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -47133,18 +46993,17 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "firewallPolicy": c.firewallPolicy, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.removeRule" call. +// Do executes the "compute.networkFirewallPolicies.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkFirewallPoliciesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47176,81 +47035,162 @@ func (c *NetworkFirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) return ret, nil } -type NetworkFirewallPoliciesSetIamPolicyCall struct { - s *Service - project string - resource string - globalsetpolicyrequest *GlobalSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// List: Lists all the policies that have been configured for the specified +// project. // // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *NetworkFirewallPoliciesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *NetworkFirewallPoliciesSetIamPolicyCall { - c := &NetworkFirewallPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) List(project string) *NetworkFirewallPoliciesListCall { + c := &NetworkFirewallPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.globalsetpolicyrequest = globalsetpolicyrequest + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NetworkFirewallPoliciesListCall) Filter(filter string) *NetworkFirewallPoliciesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NetworkFirewallPoliciesListCall) MaxResults(maxResults int64) *NetworkFirewallPoliciesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NetworkFirewallPoliciesListCall) OrderBy(orderBy string) *NetworkFirewallPoliciesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NetworkFirewallPoliciesListCall) PageToken(pageToken string) *NetworkFirewallPoliciesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NetworkFirewallPoliciesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkFirewallPoliciesListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesSetIamPolicyCall { +func (c *NetworkFirewallPoliciesListCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworkFirewallPoliciesListCall) IfNoneMatch(entityTag string) *NetworkFirewallPoliciesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesSetIamPolicyCall) Context(ctx context.Context) *NetworkFirewallPoliciesSetIamPolicyCall { +func (c *NetworkFirewallPoliciesListCall) Context(ctx context.Context) *NetworkFirewallPoliciesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { +func (c *NetworkFirewallPoliciesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) - if err != nil { - return nil, err +func (c *NetworkFirewallPoliciesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.setIamPolicy" call. +// Do executes the "compute.networkFirewallPolicies.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *FirewallPolicyList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NetworkFirewallPoliciesListCall) Do(opts ...googleapi.CallOption) (*FirewallPolicyList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47269,7 +47209,7 @@ func (c *NetworkFirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOptio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &FirewallPolicyList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -47282,82 +47222,116 @@ func (c *NetworkFirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOptio return ret, nil } -type NetworkFirewallPoliciesTestIamPermissionsCall struct { - s *Service - project string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NetworkFirewallPoliciesListCall) Pages(ctx context.Context, f func(*FirewallPolicyList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +type NetworkFirewallPoliciesPatchCall struct { + s *Service + project string + firewallPolicy string + firewallpolicy *FirewallPolicy + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Patches the specified policy with the data included in the request. // +// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -func (r *NetworkFirewallPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkFirewallPoliciesTestIamPermissionsCall { - c := &NetworkFirewallPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) Patch(project string, firewallPolicy string, firewallpolicy *FirewallPolicy) *NetworkFirewallPoliciesPatchCall { + c := &NetworkFirewallPoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.firewallPolicy = firewallPolicy + c.firewallpolicy = firewallpolicy + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkFirewallPoliciesPatchCall) RequestId(requestId string) *NetworkFirewallPoliciesPatchCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesTestIamPermissionsCall { +func (c *NetworkFirewallPoliciesPatchCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Context(ctx context.Context) *NetworkFirewallPoliciesTestIamPermissionsCall { +func (c *NetworkFirewallPoliciesPatchCall) Context(ctx context.Context) *NetworkFirewallPoliciesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header { +func (c *NetworkFirewallPoliciesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicy) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "resource": c.resource, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networkFirewallPolicies.testIamPermissions" call. +// Do executes the "compute.networkFirewallPolicies.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47376,7 +47350,7 @@ func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.Cal if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -47389,25 +47363,32 @@ func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.Cal return ret, nil } -type NetworksAddPeeringCall struct { - s *Service - project string - network string - networksaddpeeringrequest *NetworksAddPeeringRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesPatchRuleCall struct { + s *Service + project string + firewallPolicy string + firewallpolicyrule *FirewallPolicyRule + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AddPeering: Adds a peering to the specified network. +// PatchRule: Patches a rule of the specified priority. // -// - network: Name of the network resource to add peering to. +// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall { - c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) PatchRule(project string, firewallPolicy string, firewallpolicyrule *FirewallPolicyRule) *NetworkFirewallPoliciesPatchRuleCall { + c := &NetworkFirewallPoliciesPatchRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network - c.networksaddpeeringrequest = networksaddpeeringrequest + c.firewallPolicy = firewallPolicy + c.firewallpolicyrule = firewallpolicyrule + return c +} + +// Priority sets the optional parameter "priority": The priority of the rule to +// patch. +func (c *NetworkFirewallPoliciesPatchRuleCall) Priority(priority int64) *NetworkFirewallPoliciesPatchRuleCall { + c.urlParams_.Set("priority", fmt.Sprint(priority)) return c } @@ -47421,7 +47402,7 @@ func (r *NetworksService) AddPeering(project string, network string, networksadd // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall { +func (c *NetworkFirewallPoliciesPatchRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesPatchRuleCall { c.urlParams_.Set("requestId", requestId) return c } @@ -47429,36 +47410,36 @@ func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeering // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall { +func (c *NetworkFirewallPoliciesPatchRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesPatchRuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall { +func (c *NetworkFirewallPoliciesPatchRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesPatchRuleCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksAddPeeringCall) Header() http.Header { +func (c *NetworkFirewallPoliciesPatchRuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesPatchRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewallpolicyrule) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/addPeering") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/patchRule") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -47466,18 +47447,18 @@ func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "network": c.network, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.addPeering" call. +// Do executes the "compute.networkFirewallPolicies.patchRule" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkFirewallPoliciesPatchRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47509,23 +47490,30 @@ func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, e return ret, nil } -type NetworksDeleteCall struct { - s *Service - project string - network string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesRemoveAssociationCall struct { + s *Service + project string + firewallPolicy string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified network. +// RemoveAssociation: Removes an association for the specified firewall policy. // -// - network: Name of the network to delete. +// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { - c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) RemoveAssociation(project string, firewallPolicy string) *NetworkFirewallPoliciesRemoveAssociationCall { + c := &NetworkFirewallPoliciesRemoveAssociationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network + c.firewallPolicy = firewallPolicy + return c +} + +// Name sets the optional parameter "name": Name for the attachment that will +// be removed. +func (c *NetworkFirewallPoliciesRemoveAssociationCall) Name(name string) *NetworkFirewallPoliciesRemoveAssociationCall { + c.urlParams_.Set("name", name) return c } @@ -47539,7 +47527,7 @@ func (r *NetworksService) Delete(project string, network string) *NetworksDelete // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall { +func (c *NetworkFirewallPoliciesRemoveAssociationCall) RequestId(requestId string) *NetworkFirewallPoliciesRemoveAssociationCall { c.urlParams_.Set("requestId", requestId) return c } @@ -47547,51 +47535,51 @@ func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall { +func (c *NetworkFirewallPoliciesRemoveAssociationCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesRemoveAssociationCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall { +func (c *NetworkFirewallPoliciesRemoveAssociationCall) Context(ctx context.Context) *NetworkFirewallPoliciesRemoveAssociationCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksDeleteCall) Header() http.Header { +func (c *NetworkFirewallPoliciesRemoveAssociationCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesRemoveAssociationCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeAssociation") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "network": c.network, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.delete" call. +// Do executes the "compute.networkFirewallPolicies.removeAssociation" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworkFirewallPoliciesRemoveAssociationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47623,86 +47611,96 @@ func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error return ret, nil } -type NetworksGetCall struct { - s *Service - project string - network string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesRemoveRuleCall struct { + s *Service + project string + firewallPolicy string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified network. +// RemoveRule: Deletes a rule of the specified priority. // -// - network: Name of the network to return. +// - firewallPolicy: Name of the firewall policy to update. // - project: Project ID for this request. -func (r *NetworksService) Get(project string, network string) *NetworksGetCall { - c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkFirewallPoliciesService) RemoveRule(project string, firewallPolicy string) *NetworkFirewallPoliciesRemoveRuleCall { + c := &NetworkFirewallPoliciesRemoveRuleCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network + c.firewallPolicy = firewallPolicy + return c +} + +// Priority sets the optional parameter "priority": The priority of the rule to +// remove from the firewall policy. +func (c *NetworkFirewallPoliciesRemoveRuleCall) Priority(priority int64) *NetworkFirewallPoliciesRemoveRuleCall { + c.urlParams_.Set("priority", fmt.Sprint(priority)) + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworkFirewallPoliciesRemoveRuleCall) RequestId(requestId string) *NetworkFirewallPoliciesRemoveRuleCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall { +func (c *NetworkFirewallPoliciesRemoveRuleCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesRemoveRuleCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall { +func (c *NetworkFirewallPoliciesRemoveRuleCall) Context(ctx context.Context) *NetworkFirewallPoliciesRemoveRuleCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksGetCall) Header() http.Header { +func (c *NetworkFirewallPoliciesRemoveRuleCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesRemoveRuleCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{firewallPolicy}/removeRule") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "network": c.network, + "project": c.project, + "firewallPolicy": c.firewallPolicy, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.get" call. +// Do executes the "compute.networkFirewallPolicies.removeRule" call. // Any non-2xx status code is an error. Response headers are in either -// *Network.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) { +func (c *NetworkFirewallPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47721,7 +47719,7 @@ func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Network{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -47734,87 +47732,81 @@ func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) { return ret, nil } -type NetworksGetEffectiveFirewallsCall struct { - s *Service - project string - network string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesSetIamPolicyCall struct { + s *Service + project string + resource string + globalsetpolicyrequest *GlobalSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetEffectiveFirewalls: Returns the effective firewalls on a given network. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - network: Name of the network for this request. // - project: Project ID for this request. -func (r *NetworksService) GetEffectiveFirewalls(project string, network string) *NetworksGetEffectiveFirewallsCall { - c := &NetworksGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *NetworkFirewallPoliciesService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *NetworkFirewallPoliciesSetIamPolicyCall { + c := &NetworkFirewallPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network + c.resource = resource + c.globalsetpolicyrequest = globalsetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *NetworksGetEffectiveFirewallsCall { +func (c *NetworkFirewallPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NetworksGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *NetworksGetEffectiveFirewallsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NetworksGetEffectiveFirewallsCall) Context(ctx context.Context) *NetworksGetEffectiveFirewallsCall { +func (c *NetworkFirewallPoliciesSetIamPolicyCall) Context(ctx context.Context) *NetworkFirewallPoliciesSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksGetEffectiveFirewallsCall) Header() http.Header { +func (c *NetworkFirewallPoliciesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NetworkFirewallPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/getEffectiveFirewalls") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "network": c.network, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.getEffectiveFirewalls" call. +// Do executes the "compute.networkFirewallPolicies.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworksGetEffectiveFirewallsResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NetworksGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*NetworksGetEffectiveFirewallsResponse, error) { +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47833,7 +47825,7 @@ func (c *NetworksGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*N if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworksGetEffectiveFirewallsResponse{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -47846,74 +47838,62 @@ func (c *NetworksGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*N return ret, nil } -type NetworksInsertCall struct { - s *Service - project string - network *Network - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworkFirewallPoliciesTestIamPermissionsCall struct { + s *Service + project string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a network in the specified project using the data included -// in the request. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // // - project: Project ID for this request. -func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { - c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *NetworkFirewallPoliciesService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *NetworkFirewallPoliciesTestIamPermissionsCall { + c := &NetworkFirewallPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall { +func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NetworkFirewallPoliciesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall { +func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Context(ctx context.Context) *NetworkFirewallPoliciesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksInsertCall) Header() http.Header { +func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkFirewallPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/firewallPolicies/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -47921,17 +47901,19 @@ func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.insert" call. +// Do executes the "compute.networkFirewallPolicies.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworkFirewallPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -47950,7 +47932,7 @@ func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -47963,106 +47945,31 @@ func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error return ret, nil } -type NetworksListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworkProfilesGetCall struct { + s *Service + project string + networkProfile string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// List: Retrieves the list of networks available to the specified project. +// Get: Returns the specified network profile. // +// - networkProfile: Name of the network profile to return. // - project: Project ID for this request. -func (r *NetworksService) List(project string) *NetworksListCall { - c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkProfilesService) Get(project string, networkProfile string) *NetworkProfilesGetCall { + c := &NetworkProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NetworksListCall) Filter(filter string) *NetworksListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NetworksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworksListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + c.networkProfile = networkProfile return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall { +func (c *NetworkProfilesGetCall) Fields(s ...googleapi.Field) *NetworkProfilesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -48070,27 +47977,27 @@ func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall { // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall { +func (c *NetworkProfilesGetCall) IfNoneMatch(entityTag string) *NetworkProfilesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall { +func (c *NetworkProfilesGetCall) Context(ctx context.Context) *NetworkProfilesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksListCall) Header() http.Header { +func (c *NetworkProfilesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkProfilesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -48098,7 +48005,7 @@ func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles/{networkProfile}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -48106,17 +48013,18 @@ func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "networkProfile": c.networkProfile, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.list" call. +// Do executes the "compute.networkProfiles.get" call. // Any non-2xx status code is an error. Response headers are in either -// *NetworkList.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *NetworkProfile.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) { +func (c *NetworkProfilesGetCall) Do(opts ...googleapi.CallOption) (*NetworkProfile, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -48135,7 +48043,7 @@ func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NetworkList{ + ret := &NetworkProfile{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -48148,58 +48056,22 @@ func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NetworksListPeeringRoutesCall struct { +type NetworkProfilesListCall struct { s *Service project string - network string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// ListPeeringRoutes: Lists the peering routes exchanged over peering -// connection. +// List: Retrieves a list of network profiles available to the specified +// project. // -// - network: Name of the network for this request. // - project: Project ID for this request. -func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall { - c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworkProfilesService) List(project string) *NetworkProfilesListCall { + c := &NetworkProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network - return c -} - -// Direction sets the optional parameter "direction": The direction of the -// exchanged routes. -// -// Possible values: -// -// "INCOMING" - For routes exported from peer network. -// "OUTGOING" - For routes exported from local network. -func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall { - c.urlParams_.Set("direction", direction) return c } @@ -48235,7 +48107,7 @@ func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksLis // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) Filter(filter string) *NetworkProfilesListCall { c.urlParams_.Set("filter", filter) return c } @@ -48245,7 +48117,7 @@ func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeri // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) MaxResults(maxResults int64) *NetworkProfilesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -48258,31 +48130,16 @@ func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksLi // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) OrderBy(orderBy string) *NetworkProfilesListCall { c.urlParams_.Set("orderBy", orderBy) return c } // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// PeeringName sets the optional parameter "peeringName": The response will -// show routes exchanged over the given peering connection. -func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall { - c.urlParams_.Set("peeringName", peeringName) - return c -} - -// Region sets the optional parameter "region": The region of the request. The -// response will include all subnet routes, static routes and dynamic routes in -// the region. -func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall { - c.urlParams_.Set("region", region) +// request to get the next page of results. +func (c *NetworkProfilesListCall) PageToken(pageToken string) *NetworkProfilesListCall { + c.urlParams_.Set("pageToken", pageToken) return c } @@ -48291,7 +48148,7 @@ func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeri // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NetworksListPeeringRoutesCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworkProfilesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -48299,7 +48156,7 @@ func (c *NetworksListPeeringRoutesCall) ReturnPartialSuccess(returnPartialSucces // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) Fields(s ...googleapi.Field) *NetworkProfilesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -48307,27 +48164,27 @@ func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksLi // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) IfNoneMatch(entityTag string) *NetworkProfilesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall { +func (c *NetworkProfilesListCall) Context(ctx context.Context) *NetworkProfilesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksListPeeringRoutesCall) Header() http.Header { +func (c *NetworkProfilesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworkProfilesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -48335,7 +48192,7 @@ func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, e var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listPeeringRoutes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networkProfiles") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -48344,18 +48201,17 @@ func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, e req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.listPeeringRoutes" call. +// Do executes the "compute.networkProfiles.list" call. // Any non-2xx status code is an error. Response headers are in either -// *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response was +// *NetworkProfilesListResponse.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) { +func (c *NetworkProfilesListCall) Do(opts ...googleapi.CallOption) (*NetworkProfilesListResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -48374,7 +48230,7 @@ func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*Excha if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ExchangedPeeringRoutesList{ + ret := &NetworkProfilesListResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -48390,7 +48246,7 @@ func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*Excha // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error { +func (c *NetworkProfilesListCall) Pages(ctx context.Context, f func(*NetworkProfilesListResponse) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -48408,26 +48264,143 @@ func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*Excha } } -type NetworksPatchCall struct { +type NetworksAddPeeringCall struct { + s *Service + project string + network string + networksaddpeeringrequest *NetworksAddPeeringRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AddPeering: Adds a peering to the specified network. +// +// - network: Name of the network resource to add peering to. +// - project: Project ID for this request. +func (r *NetworksService) AddPeering(project string, network string, networksaddpeeringrequest *NetworksAddPeeringRequest) *NetworksAddPeeringCall { + c := &NetworksAddPeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.network = network + c.networksaddpeeringrequest = networksaddpeeringrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworksAddPeeringCall) RequestId(requestId string) *NetworksAddPeeringCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworksAddPeeringCall) Fields(s ...googleapi.Field) *NetworksAddPeeringCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *NetworksAddPeeringCall) Context(ctx context.Context) *NetworksAddPeeringCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NetworksAddPeeringCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NetworksAddPeeringCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksaddpeeringrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/addPeering") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "network": c.network, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.networks.addPeering" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworksAddPeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type NetworksDeleteCall struct { s *Service project string network string - network2 *Network urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Patch: Patches the specified network with the data included in the request. -// Only routingConfig can be modified. +// Delete: Deletes the specified network. // -// - network: Name of the network to update. +// - network: Name of the network to delete. // - project: Project ID for this request. -func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall { - c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { + c := &NetworksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.network = network - c.network2 = network2 return c } @@ -48441,7 +48414,7 @@ func (r *NetworksService) Patch(project string, network string, network2 *Networ // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall { +func (c *NetworksDeleteCall) RequestId(requestId string) *NetworksDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -48449,38 +48422,145 @@ func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall { +func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NetworksDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "network": c.network, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.networks.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NetworksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type NetworksGetCall struct { + s *Service + project string + network string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the specified network. +// +// - network: Name of the network to return. +// - project: Project ID for this request. +func (r *NetworksService) Get(project string, network string) *NetworksGetCall { + c := &NetworksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.network = network + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworksGetCall) IfNoneMatch(entityTag string) *NetworksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall { +func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksPatchCall) Header() http.Header { +func (c *NetworksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2) - if err != nil { - return nil, err +func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -48492,12 +48572,12 @@ func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.patch" call. +// Do executes the "compute.networks.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Network.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworksGetCall) Do(opts ...googleapi.CallOption) (*Network, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -48516,7 +48596,7 @@ func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Network{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -48529,78 +48609,69 @@ func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) return ret, nil } -type NetworksRemovePeeringCall struct { - s *Service - project string - network string - networksremovepeeringrequest *NetworksRemovePeeringRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworksGetEffectiveFirewallsCall struct { + s *Service + project string + network string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// RemovePeering: Removes a peering from the specified network. +// GetEffectiveFirewalls: Returns the effective firewalls on a given network. // -// - network: Name of the network resource to remove peering from. +// - network: Name of the network for this request. // - project: Project ID for this request. -func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall { - c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) GetEffectiveFirewalls(project string, network string) *NetworksGetEffectiveFirewallsCall { + c := &NetworksGetEffectiveFirewallsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.network = network - c.networksremovepeeringrequest = networksremovepeeringrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall { - c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall { +func (c *NetworksGetEffectiveFirewallsCall) Fields(s ...googleapi.Field) *NetworksGetEffectiveFirewallsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworksGetEffectiveFirewallsCall) IfNoneMatch(entityTag string) *NetworksGetEffectiveFirewallsCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall { +func (c *NetworksGetEffectiveFirewallsCall) Context(ctx context.Context) *NetworksGetEffectiveFirewallsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksRemovePeeringCall) Header() http.Header { +func (c *NetworksGetEffectiveFirewallsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest) - if err != nil { - return nil, err +func (c *NetworksGetEffectiveFirewallsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/removePeering") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/getEffectiveFirewalls") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -48612,12 +48683,13 @@ func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.removePeering" call. +// Do executes the "compute.networks.getEffectiveFirewalls" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *NetworksGetEffectiveFirewallsResponse.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksGetEffectiveFirewallsCall) Do(opts ...googleapi.CallOption) (*NetworksGetEffectiveFirewallsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -48636,7 +48708,7 @@ func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NetworksGetEffectiveFirewallsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -48649,22 +48721,21 @@ func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation return ret, nil } -type NetworksSwitchToCustomModeCall struct { +type NetworksInsertCall struct { s *Service project string - network string + network *Network urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// SwitchToCustomMode: Switches the network mode from auto subnet mode to -// custom subnet mode. +// Insert: Creates a network in the specified project using the data included +// in the request. // -// - network: Name of the network to be updated. // - project: Project ID for this request. -func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall { - c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { + c := &NetworksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.network = network return c @@ -48680,7 +48751,7 @@ func (r *NetworksService) SwitchToCustomMode(project string, network string) *Ne // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall { +func (c *NetworksInsertCall) RequestId(requestId string) *NetworksInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -48688,32 +48759,36 @@ func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSw // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall { +func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall { +func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NetworksSwitchToCustomModeCall) Header() http.Header { +func (c *NetworksInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/switchToCustomMode") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -48722,17 +48797,16 @@ func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.networks.switchToCustomMode" call. +// Do executes the "compute.networks.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -48764,222 +48838,160 @@ func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type NetworksUpdatePeeringCall struct { - s *Service - project string - network string - networksupdatepeeringrequest *NetworksUpdatePeeringRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NetworksListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// UpdatePeering: Updates the specified network peering with the data included -// in the request. You can only modify the NetworkPeering.export_custom_routes -// field and the NetworkPeering.import_custom_routes field. +// List: Retrieves the list of networks available to the specified project. // -// - network: Name of the network resource which the updated peering is -// belonging to. -// - project: Project ID for this request. -func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall { - c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *NetworksService) List(project string) *NetworksListCall { + c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.network = network - c.networksupdatepeeringrequest = networksupdatepeeringrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall { - c.ctx_ = ctx return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *NetworksUpdatePeeringCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/updatePeering") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "network": c.network, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NetworksListCall) Filter(filter string) *NetworksListCall { + c.urlParams_.Set("filter", filter) + return c } -// Do executes the "compute.networks.updatePeering" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c } -type NodeGroupsAddNodesCall struct { - s *Service - project string - zone string - nodeGroup string - nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NetworksListCall) OrderBy(orderBy string) *NetworksListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -// AddNodes: Adds specified number of nodes to the node group. -// -// - nodeGroup: Name of the NodeGroup resource. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall { - c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.zone = zone - c.nodeGroup = nodeGroup - c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { + c.urlParams_.Set("pageToken", pageToken) return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall { - c.urlParams_.Set("requestId", requestId) +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NetworksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworksListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall { +func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NetworksListCall) IfNoneMatch(entityTag string) *NetworksListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall { +func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsAddNodesCall) Header() http.Header { +func (c *NetworksListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest) - if err != nil { - return nil, err +func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "nodeGroup": c.nodeGroup, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.addNodes" call. +// Do executes the "compute.networks.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *NetworkList.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworksListCall) Do(opts ...googleapi.CallOption) (*NetworkList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -48998,7 +49010,7 @@ func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NetworkList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -49011,24 +49023,58 @@ func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, e return ret, nil } -type NodeGroupsAggregatedListCall struct { +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NetworksListCall) Pages(ctx context.Context, f func(*NetworkList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type NetworksListPeeringRoutesCall struct { s *Service project string + network string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves an aggregated list of node groups. Note: use -// nodeGroups.listNodes for more details about each group. To prevent failure, -// Google recommends that you set the `returnPartialSuccess` parameter to -// `true`. +// ListPeeringRoutes: Lists the peering routes exchanged over peering +// connection. // +// - network: Name of the network for this request. // - project: Project ID for this request. -func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall { - c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) ListPeeringRoutes(project string, network string) *NetworksListPeeringRoutesCall { + c := &NetworksListPeeringRoutesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.network = network + return c +} + +// Direction sets the optional parameter "direction": The direction of the +// exchanged routes. +// +// Possible values: +// +// "INCOMING" - For routes exported from peer network. +// "OUTGOING" - For routes exported from local network. +func (c *NetworksListPeeringRoutesCall) Direction(direction string) *NetworksListPeeringRoutesCall { + c.urlParams_.Set("direction", direction) return c } @@ -49064,30 +49110,17 @@ func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregated // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) Filter(filter string) *NetworksListPeeringRoutesCall { c.urlParams_.Set("filter", filter) return c } -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *NodeGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeGroupsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) MaxResults(maxResults int64) *NetworksListPeeringRoutesCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -49100,7 +49133,7 @@ func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsA // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) OrderBy(orderBy string) *NetworksListPeeringRoutesCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -49108,33 +49141,40 @@ func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggreg // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) PageToken(pageToken string) *NetworksListPeeringRoutesCall { c.urlParams_.Set("pageToken", pageToken) return c } +// PeeringName sets the optional parameter "peeringName": The response will +// show routes exchanged over the given peering connection. +func (c *NetworksListPeeringRoutesCall) PeeringName(peeringName string) *NetworksListPeeringRoutesCall { + c.urlParams_.Set("peeringName", peeringName) + return c +} + +// Region sets the optional parameter "region": The region of the request. The +// response will include all subnet routes, static routes and dynamic routes in +// the region. +func (c *NetworksListPeeringRoutesCall) Region(region string) *NetworksListPeeringRoutesCall { + c.urlParams_.Set("region", region) + return c +} + // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": // Opt-in for partial success behavior which provides partial results in case // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NodeGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) ReturnPartialSuccess(returnPartialSuccess bool) *NetworksListPeeringRoutesCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *NodeGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeGroupsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) Fields(s ...googleapi.Field) *NetworksListPeeringRoutesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -49142,27 +49182,27 @@ func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsA // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) IfNoneMatch(entityTag string) *NetworksListPeeringRoutesCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall { +func (c *NetworksListPeeringRoutesCall) Context(ctx context.Context) *NetworksListPeeringRoutesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsAggregatedListCall) Header() http.Header { +func (c *NetworksListPeeringRoutesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworksListPeeringRoutesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -49170,7 +49210,7 @@ func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, er var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/listPeeringRoutes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -49179,17 +49219,18 @@ func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, er req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.aggregatedList" call. +// Do executes the "compute.networks.listPeeringRoutes" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeGroupAggregatedList.ServerResponse.Header or (if a response was +// *ExchangedPeeringRoutesList.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) { +func (c *NetworksListPeeringRoutesCall) Do(opts ...googleapi.CallOption) (*ExchangedPeeringRoutesList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -49208,7 +49249,7 @@ func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGr if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeGroupAggregatedList{ + ret := &ExchangedPeeringRoutesList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -49224,7 +49265,7 @@ func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGr // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error { +func (c *NetworksListPeeringRoutesCall) Pages(ctx context.Context, f func(*ExchangedPeeringRoutesList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -49242,26 +49283,26 @@ func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGr } } -type NodeGroupsDeleteCall struct { +type NetworksPatchCall struct { s *Service project string - zone string - nodeGroup string + network string + network2 *Network urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Delete: Deletes the specified NodeGroup resource. +// Patch: Patches the specified network with the data included in the request. +// Only routingConfig can be modified. // -// - nodeGroup: Name of the NodeGroup resource to delete. +// - network: Name of the network to update. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall { - c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) Patch(project string, network string, network2 *Network) *NetworksPatchCall { + c := &NetworksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.nodeGroup = nodeGroup + c.network = network + c.network2 = network2 return c } @@ -49275,7 +49316,7 @@ func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall { +func (c *NetworksPatchCall) RequestId(requestId string) *NetworksPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -49283,52 +49324,55 @@ func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall { +func (c *NetworksPatchCall) Fields(s ...googleapi.Field) *NetworksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall { +func (c *NetworksPatchCall) Context(ctx context.Context) *NetworksPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsDeleteCall) Header() http.Header { +func (c *NetworksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *NetworksPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.network2) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "nodeGroup": c.nodeGroup, + "project": c.project, + "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.delete" call. +// Do executes the "compute.networks.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -49360,28 +49404,25 @@ func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, err return ret, nil } -type NodeGroupsDeleteNodesCall struct { +type NetworksRemovePeeringCall struct { s *Service project string - zone string - nodeGroup string - nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest + network string + networksremovepeeringrequest *NetworksRemovePeeringRequest urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// DeleteNodes: Deletes specified nodes from the node group. +// RemovePeering: Removes a peering from the specified network. // -// - nodeGroup: Name of the NodeGroup resource whose nodes will be deleted. +// - network: Name of the network resource to remove peering from. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall { - c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) RemovePeering(project string, network string, networksremovepeeringrequest *NetworksRemovePeeringRequest) *NetworksRemovePeeringCall { + c := &NetworksRemovePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.nodeGroup = nodeGroup - c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest + c.network = network + c.networksremovepeeringrequest = networksremovepeeringrequest return c } @@ -49395,7 +49436,7 @@ func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup s // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall { +func (c *NetworksRemovePeeringCall) RequestId(requestId string) *NetworksRemovePeeringCall { c.urlParams_.Set("requestId", requestId) return c } @@ -49403,36 +49444,36 @@ func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDelet // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall { +func (c *NetworksRemovePeeringCall) Fields(s ...googleapi.Field) *NetworksRemovePeeringCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall { +func (c *NetworksRemovePeeringCall) Context(ctx context.Context) *NetworksRemovePeeringCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsDeleteNodesCall) Header() http.Header { +func (c *NetworksRemovePeeringCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworksRemovePeeringCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksremovepeeringrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/removePeering") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -49440,19 +49481,18 @@ func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "nodeGroup": c.nodeGroup, + "project": c.project, + "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.deleteNodes" call. +// Do executes the "compute.networks.removePeering" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NetworksRemovePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -49484,92 +49524,90 @@ func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation return ret, nil } -type NodeGroupsGetCall struct { - s *Service - project string - zone string - nodeGroup string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworksSwitchToCustomModeCall struct { + s *Service + project string + network string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified NodeGroup. Get a list of available NodeGroups by -// making a list() request. Note: the "nodes" field should not be used. Use -// nodeGroups.listNodes instead. +// SwitchToCustomMode: Switches the network mode from auto subnet mode to +// custom subnet mode. // -// - nodeGroup: Name of the node group to return. +// - network: Name of the network to be updated. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall { - c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NetworksService) SwitchToCustomMode(project string, network string) *NetworksSwitchToCustomModeCall { + c := &NetworksSwitchToCustomModeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.nodeGroup = nodeGroup + c.network = network + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworksSwitchToCustomModeCall) RequestId(requestId string) *NetworksSwitchToCustomModeCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall { +func (c *NetworksSwitchToCustomModeCall) Fields(s ...googleapi.Field) *NetworksSwitchToCustomModeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall { +func (c *NetworksSwitchToCustomModeCall) Context(ctx context.Context) *NetworksSwitchToCustomModeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsGetCall) Header() http.Header { +func (c *NetworksSwitchToCustomModeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *NetworksSwitchToCustomModeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/switchToCustomMode") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "nodeGroup": c.nodeGroup, + "project": c.project, + "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.get" call. +// Do executes the "compute.networks.switchToCustomMode" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeGroup.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) { +func (c *NetworksSwitchToCustomModeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -49588,7 +49626,7 @@ func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeGroup{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -49601,98 +49639,98 @@ func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) return ret, nil } -type NodeGroupsGetIamPolicyCall struct { - s *Service - project string - zone string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NetworksUpdatePeeringCall struct { + s *Service + project string + network string + networksupdatepeeringrequest *NetworksUpdatePeeringRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// UpdatePeering: Updates the specified network peering with the data included +// in the request. You can only modify the NetworkPeering.export_custom_routes +// field and the NetworkPeering.import_custom_routes field. // -// - project: Project ID for this request. -// - resource: Name or id of the resource for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall { - c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - network: Name of the network resource which the updated peering is +// belonging to. +// - project: Project ID for this request. +func (r *NetworksService) UpdatePeering(project string, network string, networksupdatepeeringrequest *NetworksUpdatePeeringRequest) *NetworksUpdatePeeringCall { + c := &NetworksUpdatePeeringCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.resource = resource - return c -} - -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *NodeGroupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NodeGroupsGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) + c.network = network + c.networksupdatepeeringrequest = networksupdatepeeringrequest return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NetworksUpdatePeeringCall) RequestId(requestId string) *NetworksUpdatePeeringCall { + c.urlParams_.Set("requestId", requestId) return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall { - c.ifNoneMatch_ = entityTag +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NetworksUpdatePeeringCall) Fields(s ...googleapi.Field) *NetworksUpdatePeeringCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall { +func (c *NetworksUpdatePeeringCall) Context(ctx context.Context) *NetworksUpdatePeeringCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsGetIamPolicyCall) Header() http.Header { +func (c *NetworksUpdatePeeringCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NetworksUpdatePeeringCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.networksupdatepeeringrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/networks/{network}/updatePeering") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "network": c.network, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.getIamPolicy" call. +// Do executes the "compute.networks.updatePeering" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *NetworksUpdatePeeringCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -49711,7 +49749,7 @@ func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -49724,28 +49762,28 @@ func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, return ret, nil } -type NodeGroupsInsertCall struct { - s *Service - project string - zone string - nodegroup *NodeGroup - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeGroupsAddNodesCall struct { + s *Service + project string + zone string + nodeGroup string + nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a NodeGroup resource in the specified project using the data -// included in the request. +// AddNodes: Adds specified number of nodes to the node group. // -// - initialNodeCount: Initial count of nodes in the node group. +// - nodeGroup: Name of the NodeGroup resource. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall { - c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) AddNodes(project string, zone string, nodeGroup string, nodegroupsaddnodesrequest *NodeGroupsAddNodesRequest) *NodeGroupsAddNodesCall { + c := &NodeGroupsAddNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount)) - c.nodegroup = nodegroup + c.nodeGroup = nodeGroup + c.nodegroupsaddnodesrequest = nodegroupsaddnodesrequest return c } @@ -49759,7 +49797,7 @@ func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall { +func (c *NodeGroupsAddNodesCall) RequestId(requestId string) *NodeGroupsAddNodesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -49767,36 +49805,36 @@ func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall { +func (c *NodeGroupsAddNodesCall) Fields(s ...googleapi.Field) *NodeGroupsAddNodesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall { +func (c *NodeGroupsAddNodesCall) Context(ctx context.Context) *NodeGroupsAddNodesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsInsertCall) Header() http.Header { +func (c *NodeGroupsAddNodesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsAddNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsaddnodesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -49804,18 +49842,19 @@ func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, + "project": c.project, + "zone": c.zone, + "nodeGroup": c.nodeGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.insert" call. +// Do executes the "compute.nodeGroups.addNodes" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeGroupsAddNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -49847,25 +49886,24 @@ func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, err return ret, nil } -type NodeGroupsListCall struct { +type NodeGroupsAggregatedListCall struct { s *Service project string - zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of node groups available to the specified project. -// Note: use nodeGroups.listNodes for more details about each group. +// AggregatedList: Retrieves an aggregated list of node groups. Note: use +// nodeGroups.listNodes for more details about each group. To prevent failure, +// Google recommends that you set the `returnPartialSuccess` parameter to +// `true`. // // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall { - c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) AggregatedList(project string) *NodeGroupsAggregatedListCall { + c := &NodeGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone return c } @@ -49901,17 +49939,30 @@ func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCal // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) Filter(filter string) *NodeGroupsAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *NodeGroupsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeGroupsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) MaxResults(maxResults int64) *NodeGroupsAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -49924,7 +49975,7 @@ func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall { // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) OrderBy(orderBy string) *NodeGroupsAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -49932,7 +49983,7 @@ func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall { // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) PageToken(pageToken string) *NodeGroupsAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -49942,15 +49993,23 @@ func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall { // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NodeGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *NodeGroupsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeGroupsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) Fields(s ...googleapi.Field) *NodeGroupsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -49958,27 +50017,27 @@ func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall { // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) IfNoneMatch(entityTag string) *NodeGroupsAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall { +func (c *NodeGroupsAggregatedListCall) Context(ctx context.Context) *NodeGroupsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsListCall) Header() http.Header { +func (c *NodeGroupsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -49986,7 +50045,7 @@ func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -49995,17 +50054,17 @@ func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.list" call. +// Do executes the "compute.nodeGroups.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeGroupList.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) { +// *NodeGroupAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NodeGroupsAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeGroupAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50024,7 +50083,7 @@ func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, e if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeGroupList{ + ret := &NodeGroupAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50040,7 +50099,7 @@ func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, e // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error { +func (c *NodeGroupsAggregatedListCall) Pages(ctx context.Context, f func(*NodeGroupAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -50058,7 +50117,7 @@ func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) e } } -type NodeGroupsListNodesCall struct { +type NodeGroupsDeleteCall struct { s *Service project string zone string @@ -50068,128 +50127,65 @@ type NodeGroupsListNodesCall struct { header_ http.Header } -// ListNodes: Lists nodes in the node group. +// Delete: Deletes the specified NodeGroup resource. // -// - nodeGroup: Name of the NodeGroup resource whose nodes you want to list. +// - nodeGroup: Name of the NodeGroup resource to delete. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall { - c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) Delete(project string, zone string, nodeGroup string) *NodeGroupsDeleteCall { + c := &NodeGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.nodeGroup = nodeGroup return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NodeGroupsListNodesCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsListNodesCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeGroupsDeleteCall) RequestId(requestId string) *NodeGroupsDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall { +func (c *NodeGroupsDeleteCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall { +func (c *NodeGroupsDeleteCall) Context(ctx context.Context) *NodeGroupsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsListNodesCall) Header() http.Header { +func (c *NodeGroupsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -50202,13 +50198,12 @@ func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.listNodes" call. +// Do executes the "compute.nodeGroups.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeGroupsListNodes.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeGroupsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50227,7 +50222,7 @@ func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsL if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeGroupsListNodes{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50240,49 +50235,28 @@ func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsL return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NodeGroupsPatchCall struct { - s *Service - project string - zone string - nodeGroup string - nodegroup *NodeGroup - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeGroupsDeleteNodesCall struct { + s *Service + project string + zone string + nodeGroup string + nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates the specified node group. +// DeleteNodes: Deletes specified nodes from the node group. // -// - nodeGroup: Name of the NodeGroup resource to update. +// - nodeGroup: Name of the NodeGroup resource whose nodes will be deleted. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) Patch(project string, zone string, nodeGroup string, nodegroup *NodeGroup) *NodeGroupsPatchCall { - c := &NodeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) DeleteNodes(project string, zone string, nodeGroup string, nodegroupsdeletenodesrequest *NodeGroupsDeleteNodesRequest) *NodeGroupsDeleteNodesCall { + c := &NodeGroupsDeleteNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.nodeGroup = nodeGroup - c.nodegroup = nodegroup + c.nodegroupsdeletenodesrequest = nodegroupsdeletenodesrequest return c } @@ -50296,7 +50270,7 @@ func (r *NodeGroupsService) Patch(project string, zone string, nodeGroup string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsPatchCall) RequestId(requestId string) *NodeGroupsPatchCall { +func (c *NodeGroupsDeleteNodesCall) RequestId(requestId string) *NodeGroupsDeleteNodesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -50304,38 +50278,38 @@ func (c *NodeGroupsPatchCall) RequestId(requestId string) *NodeGroupsPatchCall { // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsPatchCall) Fields(s ...googleapi.Field) *NodeGroupsPatchCall { +func (c *NodeGroupsDeleteNodesCall) Fields(s ...googleapi.Field) *NodeGroupsDeleteNodesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsPatchCall) Context(ctx context.Context) *NodeGroupsPatchCall { +func (c *NodeGroupsDeleteNodesCall) Context(ctx context.Context) *NodeGroupsDeleteNodesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsPatchCall) Header() http.Header { +func (c *NodeGroupsDeleteNodesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsDeleteNodesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsdeletenodesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -50348,12 +50322,12 @@ func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.patch" call. +// Do executes the "compute.nodeGroups.deleteNodes" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeGroupsDeleteNodesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50385,100 +50359,215 @@ func (c *NodeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, erro return ret, nil } -type NodeGroupsPerformMaintenanceCall struct { - s *Service - project string - zone string - nodeGroup string - nodegroupsperformmaintenancerequest *NodeGroupsPerformMaintenanceRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeGroupsGetCall struct { + s *Service + project string + zone string + nodeGroup string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// PerformMaintenance: Perform maintenance on a subset of nodes in the node -// group. +// Get: Returns the specified NodeGroup. Get a list of available NodeGroups by +// making a list() request. Note: the "nodes" field should not be used. Use +// nodeGroups.listNodes instead. // -// - nodeGroup: Name of the node group scoping this request. +// - nodeGroup: Name of the node group to return. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) PerformMaintenance(project string, zone string, nodeGroup string, nodegroupsperformmaintenancerequest *NodeGroupsPerformMaintenanceRequest) *NodeGroupsPerformMaintenanceCall { - c := &NodeGroupsPerformMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) Get(project string, zone string, nodeGroup string) *NodeGroupsGetCall { + c := &NodeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.nodeGroup = nodeGroup - c.nodegroupsperformmaintenancerequest = nodegroupsperformmaintenancerequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsPerformMaintenanceCall) RequestId(requestId string) *NodeGroupsPerformMaintenanceCall { - c.urlParams_.Set("requestId", requestId) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NodeGroupsGetCall) Fields(s ...googleapi.Field) *NodeGroupsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NodeGroupsGetCall) IfNoneMatch(entityTag string) *NodeGroupsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *NodeGroupsGetCall) Context(ctx context.Context) *NodeGroupsGetCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NodeGroupsGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NodeGroupsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "nodeGroup": c.nodeGroup, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.nodeGroups.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *NodeGroup.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeGroupsGetCall) Do(opts ...googleapi.CallOption) (*NodeGroup, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &NodeGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type NodeGroupsGetIamPolicyCall struct { + s *Service + project string + zone string + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. +// +// - project: Project ID for this request. +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) GetIamPolicy(project string, zone string, resource string) *NodeGroupsGetIamPolicyCall { + c := &NodeGroupsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.resource = resource + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *NodeGroupsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NodeGroupsGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsPerformMaintenanceCall) Fields(s ...googleapi.Field) *NodeGroupsPerformMaintenanceCall { +func (c *NodeGroupsGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NodeGroupsGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeGroupsGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsPerformMaintenanceCall) Context(ctx context.Context) *NodeGroupsPerformMaintenanceCall { +func (c *NodeGroupsGetIamPolicyCall) Context(ctx context.Context) *NodeGroupsGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsPerformMaintenanceCall) Header() http.Header { +func (c *NodeGroupsGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsperformmaintenancerequest) - if err != nil { - return nil, err +func (c *NodeGroupsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/performMaintenance") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "nodeGroup": c.nodeGroup, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.performMaintenance" call. +// Do executes the "compute.nodeGroups.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeGroupsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50497,7 +50586,7 @@ func (c *NodeGroupsPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50510,65 +50599,79 @@ func (c *NodeGroupsPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type NodeGroupsSetIamPolicyCall struct { - s *Service - project string - zone string - resource string - zonesetpolicyrequest *ZoneSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeGroupsInsertCall struct { + s *Service + project string + zone string + nodegroup *NodeGroup + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// Insert: Creates a NodeGroup resource in the specified project using the data +// included in the request. // +// - initialNodeCount: Initial count of nodes in the node group. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall { - c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) Insert(project string, zone string, initialNodeCount int64, nodegroup *NodeGroup) *NodeGroupsInsertCall { + c := &NodeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.zonesetpolicyrequest = zonesetpolicyrequest + c.urlParams_.Set("initialNodeCount", fmt.Sprint(initialNodeCount)) + c.nodegroup = nodegroup + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeGroupsInsertCall) RequestId(requestId string) *NodeGroupsInsertCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall { +func (c *NodeGroupsInsertCall) Fields(s ...googleapi.Field) *NodeGroupsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall { +func (c *NodeGroupsInsertCall) Context(ctx context.Context) *NodeGroupsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsSetIamPolicyCall) Header() http.Header { +func (c *NodeGroupsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -50576,19 +50679,18 @@ func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.setIamPolicy" call. +// Do executes the "compute.nodeGroups.insert" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *NodeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50607,7 +50709,7 @@ func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50620,99 +50722,165 @@ func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, return ret, nil } -type NodeGroupsSetNodeTemplateCall struct { - s *Service - project string - zone string - nodeGroup string - nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeGroupsListCall struct { + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetNodeTemplate: Updates the node template of the node group. +// List: Retrieves a list of node groups available to the specified project. +// Note: use nodeGroups.listNodes for more details about each group. // -// - nodeGroup: Name of the NodeGroup resource to update. // - project: Project ID for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall { - c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) List(project string, zone string) *NodeGroupsListCall { + c := &NodeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.nodeGroup = nodeGroup - c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NodeGroupsListCall) Filter(filter string) *NodeGroupsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NodeGroupsListCall) MaxResults(maxResults int64) *NodeGroupsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NodeGroupsListCall) OrderBy(orderBy string) *NodeGroupsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NodeGroupsListCall) PageToken(pageToken string) *NodeGroupsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NodeGroupsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall { +func (c *NodeGroupsListCall) Fields(s ...googleapi.Field) *NodeGroupsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NodeGroupsListCall) IfNoneMatch(entityTag string) *NodeGroupsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall { +func (c *NodeGroupsListCall) Context(ctx context.Context) *NodeGroupsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header { +func (c *NodeGroupsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } - return c.header_ -} - -func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + return c.header_ +} + +func (c *NodeGroupsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "nodeGroup": c.nodeGroup, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.setNodeTemplate" call. +// Do executes the "compute.nodeGroups.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *NodeGroupList.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeGroupsListCall) Do(opts ...googleapi.CallOption) (*NodeGroupList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50731,7 +50899,7 @@ func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Opera if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NodeGroupList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50744,81 +50912,157 @@ func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Opera return ret, nil } -type NodeGroupsSimulateMaintenanceEventCall struct { - s *Service - project string - zone string - nodeGroup string - nodegroupssimulatemaintenanceeventrequest *NodeGroupsSimulateMaintenanceEventRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NodeGroupsListCall) Pages(ctx context.Context, f func(*NodeGroupList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// SimulateMaintenanceEvent: Simulates maintenance event on specified nodes -// from the node group. +type NodeGroupsListNodesCall struct { + s *Service + project string + zone string + nodeGroup string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ListNodes: Lists nodes in the node group. // -// - nodeGroup: Name of the NodeGroup resource whose nodes will go under -// maintenance simulation. -// - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeGroupsService) SimulateMaintenanceEvent(project string, zone string, nodeGroup string, nodegroupssimulatemaintenanceeventrequest *NodeGroupsSimulateMaintenanceEventRequest) *NodeGroupsSimulateMaintenanceEventCall { - c := &NodeGroupsSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - nodeGroup: Name of the NodeGroup resource whose nodes you want to list. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) ListNodes(project string, zone string, nodeGroup string) *NodeGroupsListNodesCall { + c := &NodeGroupsListNodesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.nodeGroup = nodeGroup - c.nodegroupssimulatemaintenanceeventrequest = nodegroupssimulatemaintenanceeventrequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeGroupsSimulateMaintenanceEventCall) RequestId(requestId string) *NodeGroupsSimulateMaintenanceEventCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NodeGroupsListNodesCall) Filter(filter string) *NodeGroupsListNodesCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NodeGroupsListNodesCall) MaxResults(maxResults int64) *NodeGroupsListNodesCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NodeGroupsListNodesCall) OrderBy(orderBy string) *NodeGroupsListNodesCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NodeGroupsListNodesCall) PageToken(pageToken string) *NodeGroupsListNodesCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NodeGroupsListNodesCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeGroupsListNodesCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *NodeGroupsSimulateMaintenanceEventCall { +func (c *NodeGroupsListNodesCall) Fields(s ...googleapi.Field) *NodeGroupsListNodesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsSimulateMaintenanceEventCall) Context(ctx context.Context) *NodeGroupsSimulateMaintenanceEventCall { +func (c *NodeGroupsListNodesCall) Context(ctx context.Context) *NodeGroupsListNodesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsSimulateMaintenanceEventCall) Header() http.Header { +func (c *NodeGroupsListNodesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *NodeGroupsListNodesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssimulatemaintenanceeventrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/simulateMaintenanceEvent") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/listNodes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -50833,12 +51077,13 @@ func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Re return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.simulateMaintenanceEvent" call. +// Do executes the "compute.nodeGroups.listNodes" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NodeGroupsSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *NodeGroupsListNodes.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NodeGroupsListNodesCall) Do(opts ...googleapi.CallOption) (*NodeGroupsListNodes, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50857,7 +51102,7 @@ func (c *NodeGroupsSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NodeGroupsListNodes{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50870,86 +51115,120 @@ func (c *NodeGroupsSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption return ret, nil } -type NodeGroupsTestIamPermissionsCall struct { - s *Service - project string - zone string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NodeGroupsListNodesCall) Pages(ctx context.Context, f func(*NodeGroupsListNodes) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +type NodeGroupsPatchCall struct { + s *Service + project string + zone string + nodeGroup string + nodegroup *NodeGroup + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the specified node group. // +// - nodeGroup: Name of the NodeGroup resource to update. // - project: Project ID for this request. -// - resource: Name or id of the resource for this request. // - zone: The name of the zone for this request. -func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall { - c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeGroupsService) Patch(project string, zone string, nodeGroup string, nodegroup *NodeGroup) *NodeGroupsPatchCall { + c := &NodeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.nodeGroup = nodeGroup + c.nodegroup = nodegroup + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeGroupsPatchCall) RequestId(requestId string) *NodeGroupsPatchCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall { +func (c *NodeGroupsPatchCall) Fields(s ...googleapi.Field) *NodeGroupsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall { +func (c *NodeGroupsPatchCall) Context(ctx context.Context) *NodeGroupsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header { +func (c *NodeGroupsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroup) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "zone": c.zone, - "resource": c.resource, + "project": c.project, + "zone": c.zone, + "nodeGroup": c.nodeGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeGroups.testIamPermissions" call. +// Do executes the "compute.nodeGroups.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -50968,7 +51247,7 @@ func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*Te if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -50981,184 +51260,100 @@ func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*Te return ret, nil } -type NodeTemplatesAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NodeGroupsPerformMaintenanceCall struct { + s *Service + project string + zone string + nodeGroup string + nodegroupsperformmaintenancerequest *NodeGroupsPerformMaintenanceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AggregatedList: Retrieves an aggregated list of node templates. To prevent -// failure, Google recommends that you set the `returnPartialSuccess` parameter -// to `true`. +// PerformMaintenance: Perform maintenance on a subset of nodes in the node +// group. // +// - nodeGroup: Name of the node group scoping this request. // - project: Project ID for this request. -func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall { - c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) PerformMaintenance(project string, zone string, nodeGroup string, nodegroupsperformmaintenancerequest *NodeGroupsPerformMaintenanceRequest) *NodeGroupsPerformMaintenanceCall { + c := &NodeGroupsPerformMaintenanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.zone = zone + c.nodeGroup = nodeGroup + c.nodegroupsperformmaintenancerequest = nodegroupsperformmaintenancerequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *NodeTemplatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NodeTemplatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *NodeTemplatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeTemplatesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeGroupsPerformMaintenanceCall) RequestId(requestId string) *NodeGroupsPerformMaintenanceCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall { +func (c *NodeGroupsPerformMaintenanceCall) Fields(s ...googleapi.Field) *NodeGroupsPerformMaintenanceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall { +func (c *NodeGroupsPerformMaintenanceCall) Context(ctx context.Context) *NodeGroupsPerformMaintenanceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesAggregatedListCall) Header() http.Header { +func (c *NodeGroupsPerformMaintenanceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NodeGroupsPerformMaintenanceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupsperformmaintenancerequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/performMaintenance") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "zone": c.zone, + "nodeGroup": c.nodeGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.aggregatedList" call. +// Do executes the "compute.nodeGroups.performMaintenance" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeTemplateAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeGroupsPerformMaintenanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -51177,7 +51372,7 @@ func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Nod if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeTemplateAggregatedList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -51189,115 +51384,86 @@ func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*Nod } return ret, nil } - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NodeTemplatesDeleteCall struct { - s *Service - project string - region string - nodeTemplate string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header + +type NodeGroupsSetIamPolicyCall struct { + s *Service + project string + zone string + resource string + zonesetpolicyrequest *ZoneSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified NodeTemplate resource. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - nodeTemplate: Name of the NodeTemplate resource to delete. // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall { - c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) SetIamPolicy(project string, zone string, resource string, zonesetpolicyrequest *ZoneSetPolicyRequest) *NodeGroupsSetIamPolicyCall { + c := &NodeGroupsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.nodeTemplate = nodeTemplate - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall { - c.urlParams_.Set("requestId", requestId) + c.zone = zone + c.resource = resource + c.zonesetpolicyrequest = zonesetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall { +func (c *NodeGroupsSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeGroupsSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall { +func (c *NodeGroupsSetIamPolicyCall) Context(ctx context.Context) *NodeGroupsSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesDeleteCall) Header() http.Header { +func (c *NodeGroupsSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *NodeGroupsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.zonesetpolicyrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "nodeTemplate": c.nodeTemplate, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.delete" call. +// Do executes the "compute.nodeGroups.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeGroupsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -51316,7 +51482,7 @@ func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -51329,90 +51495,99 @@ func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type NodeTemplatesGetCall struct { - s *Service - project string - region string - nodeTemplate string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NodeGroupsSetNodeTemplateCall struct { + s *Service + project string + zone string + nodeGroup string + nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified node template. +// SetNodeTemplate: Updates the node template of the node group. // -// - nodeTemplate: Name of the node template to return. +// - nodeGroup: Name of the NodeGroup resource to update. // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall { - c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) SetNodeTemplate(project string, zone string, nodeGroup string, nodegroupssetnodetemplaterequest *NodeGroupsSetNodeTemplateRequest) *NodeGroupsSetNodeTemplateCall { + c := &NodeGroupsSetNodeTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.nodeTemplate = nodeTemplate + c.zone = zone + c.nodeGroup = nodeGroup + c.nodegroupssetnodetemplaterequest = nodegroupssetnodetemplaterequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeGroupsSetNodeTemplateCall) RequestId(requestId string) *NodeGroupsSetNodeTemplateCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall { +func (c *NodeGroupsSetNodeTemplateCall) Fields(s ...googleapi.Field) *NodeGroupsSetNodeTemplateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall { +func (c *NodeGroupsSetNodeTemplateCall) Context(ctx context.Context) *NodeGroupsSetNodeTemplateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesGetCall) Header() http.Header { +func (c *NodeGroupsSetNodeTemplateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NodeGroupsSetNodeTemplateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssetnodetemplaterequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "nodeTemplate": c.nodeTemplate, + "project": c.project, + "zone": c.zone, + "nodeGroup": c.nodeGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.get" call. +// Do executes the "compute.nodeGroups.setNodeTemplate" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeTemplate.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) { +func (c *NodeGroupsSetNodeTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -51431,7 +51606,7 @@ func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeTemplate{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -51444,98 +51619,101 @@ func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, return ret, nil } -type NodeTemplatesGetIamPolicyCall struct { - s *Service - project string - region string - resource string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NodeGroupsSimulateMaintenanceEventCall struct { + s *Service + project string + zone string + nodeGroup string + nodegroupssimulatemaintenanceeventrequest *NodeGroupsSimulateMaintenanceEventRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// SimulateMaintenanceEvent: Simulates maintenance event on specified nodes +// from the node group. // -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall { - c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - nodeGroup: Name of the NodeGroup resource whose nodes will go under +// maintenance simulation. +// - project: Project ID for this request. +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) SimulateMaintenanceEvent(project string, zone string, nodeGroup string, nodegroupssimulatemaintenanceeventrequest *NodeGroupsSimulateMaintenanceEventRequest) *NodeGroupsSimulateMaintenanceEventCall { + c := &NodeGroupsSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.resource = resource + c.zone = zone + c.nodeGroup = nodeGroup + c.nodegroupssimulatemaintenanceeventrequest = nodegroupssimulatemaintenanceeventrequest return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *NodeTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NodeTemplatesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeGroupsSimulateMaintenanceEventCall) RequestId(requestId string) *NodeGroupsSimulateMaintenanceEventCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall { +func (c *NodeGroupsSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *NodeGroupsSimulateMaintenanceEventCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall { +func (c *NodeGroupsSimulateMaintenanceEventCall) Context(ctx context.Context) *NodeGroupsSimulateMaintenanceEventCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header { +func (c *NodeGroupsSimulateMaintenanceEventCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NodeGroupsSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodegroupssimulatemaintenanceeventrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/simulateMaintenanceEvent") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "zone": c.zone, + "nodeGroup": c.nodeGroup, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.getIamPolicy" call. +// Do executes the "compute.nodeGroups.simulateMaintenanceEvent" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *NodeGroupsSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -51554,7 +51732,7 @@ func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Polic if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -51567,77 +51745,65 @@ func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Polic return ret, nil } -type NodeTemplatesInsertCall struct { - s *Service - project string - region string - nodetemplate *NodeTemplate - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeGroupsTestIamPermissionsCall struct { + s *Service + project string + zone string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a NodeTemplate resource in the specified project using the -// data included in the request. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall { - c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +// - zone: The name of the zone for this request. +func (r *NodeGroupsService) TestIamPermissions(project string, zone string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeGroupsTestIamPermissionsCall { + c := &NodeGroupsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.nodetemplate = nodetemplate - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall { - c.urlParams_.Set("requestId", requestId) + c.zone = zone + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall { +func (c *NodeGroupsTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeGroupsTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall { +func (c *NodeGroupsTestIamPermissionsCall) Context(ctx context.Context) *NodeGroupsTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesInsertCall) Header() http.Header { +func (c *NodeGroupsTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeGroupsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -51645,18 +51811,20 @@ func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "zone": c.zone, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.insert" call. +// Do executes the "compute.nodeGroups.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NodeGroupsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -51675,7 +51843,7 @@ func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -51688,24 +51856,23 @@ func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type NodeTemplatesListCall struct { +type NodeTemplatesAggregatedListCall struct { s *Service project string - region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of node templates available to the specified project. +// AggregatedList: Retrieves an aggregated list of node templates. To prevent +// failure, Google recommends that you set the `returnPartialSuccess` parameter +// to `true`. // // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall { - c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeTemplatesService) AggregatedList(project string) *NodeTemplatesAggregatedListCall { + c := &NodeTemplatesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region return c } @@ -51741,17 +51908,30 @@ func (r *NodeTemplatesService) List(project string, region string) *NodeTemplate // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall { +func (c *NodeTemplatesAggregatedListCall) Filter(filter string) *NodeTemplatesAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *NodeTemplatesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeTemplatesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall { +func (c *NodeTemplatesAggregatedListCall) MaxResults(maxResults int64) *NodeTemplatesAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -51764,7 +51944,7 @@ func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListC // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall { +func (c *NodeTemplatesAggregatedListCall) OrderBy(orderBy string) *NodeTemplatesAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -51772,7 +51952,7 @@ func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall { // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall { +func (c *NodeTemplatesAggregatedListCall) PageToken(pageToken string) *NodeTemplatesAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -51782,202 +51962,78 @@ func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCa // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *NodeTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTemplatesListCall { +func (c *NodeTemplatesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTemplatesAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *NodeTemplatesListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.nodeTemplates.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *NodeTemplateList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &NodeTemplateList{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NodeTemplatesSetIamPolicyCall struct { - s *Service - project string - region string - resource string - regionsetpolicyrequest *RegionSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. -// -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall { - c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.resource = resource - c.regionsetpolicyrequest = regionsetpolicyrequest +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *NodeTemplatesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeTemplatesAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall { +func (c *NodeTemplatesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTemplatesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NodeTemplatesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTemplatesAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall { +func (c *NodeTemplatesAggregatedListCall) Context(ctx context.Context) *NodeTemplatesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header { +func (c *NodeTemplatesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) - if err != nil { - return nil, err +func (c *NodeTemplatesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.setIamPolicy" call. +// Do executes the "compute.nodeTemplates.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *NodeTemplateAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NodeTemplatesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -51996,7 +52052,7 @@ func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Polic if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &NodeTemplateAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -52009,86 +52065,114 @@ func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Polic return ret, nil } -type NodeTemplatesTestIamPermissionsCall struct { - s *Service - project string - region string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NodeTemplatesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTemplateAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +type NodeTemplatesDeleteCall struct { + s *Service + project string + region string + nodeTemplate string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified NodeTemplate resource. // +// - nodeTemplate: Name of the NodeTemplate resource to delete. // - project: Project ID for this request. // - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall { - c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeTemplatesService) Delete(project string, region string, nodeTemplate string) *NodeTemplatesDeleteCall { + c := &NodeTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.nodeTemplate = nodeTemplate + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeTemplatesDeleteCall) RequestId(requestId string) *NodeTemplatesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall { +func (c *NodeTemplatesDeleteCall) Fields(s ...googleapi.Field) *NodeTemplatesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall { +func (c *NodeTemplatesDeleteCall) Context(ctx context.Context) *NodeTemplatesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header { +func (c *NodeTemplatesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *NodeTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "nodeTemplate": c.nodeTemplate, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTemplates.testIamPermissions" call. +// Do executes the "compute.nodeTemplates.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -52107,7 +52191,7 @@ func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -52116,133 +52200,38 @@ func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) ( target := &ret if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err - } - return ret, nil -} - -type NodeTypesAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// AggregatedList: Retrieves an aggregated list of node types. To prevent -// failure, Google recommends that you set the `returnPartialSuccess` parameter -// to `true`. -// -// - project: Project ID for this request. -func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall { - c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *NodeTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeTypesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c + } + return ret, nil } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NodeTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTypesAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c +type NodeTemplatesGetCall struct { + s *Service + project string + region string + nodeTemplate string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *NodeTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeTypesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +// Get: Returns the specified node template. +// +// - nodeTemplate: Name of the node template to return. +// - project: Project ID for this request. +// - region: The name of the region for this request. +func (r *NodeTemplatesService) Get(project string, region string, nodeTemplate string) *NodeTemplatesGetCall { + c := &NodeTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.nodeTemplate = nodeTemplate return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall { +func (c *NodeTemplatesGetCall) Fields(s ...googleapi.Field) *NodeTemplatesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -52250,27 +52239,27 @@ func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAgg // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall { +func (c *NodeTemplatesGetCall) IfNoneMatch(entityTag string) *NodeTemplatesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall { +func (c *NodeTemplatesGetCall) Context(ctx context.Context) *NodeTemplatesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTypesAggregatedListCall) Header() http.Header { +func (c *NodeTemplatesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeTemplatesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -52278,7 +52267,7 @@ func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -52286,18 +52275,19 @@ func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "region": c.region, + "nodeTemplate": c.nodeTemplate, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTypes.aggregatedList" call. +// Do executes the "compute.nodeTemplates.get" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeTypeAggregatedList.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) { +// *NodeTemplate.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeTemplatesGetCall) Do(opts ...googleapi.CallOption) (*NodeTemplate, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -52316,7 +52306,7 @@ func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTyp if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeTypeAggregatedList{ + ret := &NodeTemplate{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -52329,55 +52319,42 @@ func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTyp return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type NodeTypesGetCall struct { +type NodeTemplatesGetIamPolicyCall struct { s *Service project string - zone string - nodeType string + region string + resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns the specified node type. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // -// - nodeType: Name of the node type to return. // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall { - c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *NodeTemplatesService) GetIamPolicy(project string, region string, resource string) *NodeTemplatesGetIamPolicyCall { + c := &NodeTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - c.nodeType = nodeType + c.region = region + c.resource = resource + return c +} + +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *NodeTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *NodeTemplatesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall { +func (c *NodeTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -52385,27 +52362,27 @@ func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall { // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall { +func (c *NodeTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *NodeTemplatesGetIamPolicyCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall { +func (c *NodeTemplatesGetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTypesGetCall) Header() http.Header { +func (c *NodeTemplatesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -52413,7 +52390,7 @@ func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes/{nodeType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -52422,18 +52399,18 @@ func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, - "nodeType": c.nodeType, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTypes.get" call. +// Do executes the "compute.nodeTemplates.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeType.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) { +func (c *NodeTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -52452,7 +52429,7 @@ func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeType{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -52465,164 +52442,96 @@ func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) { return ret, nil } -type NodeTypesListCall struct { +type NodeTemplatesInsertCall struct { s *Service project string - zone string + region string + nodetemplate *NodeTemplate urlParams_ gensupport.URLParams - ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of node types available to the specified project. +// Insert: Creates a NodeTemplate resource in the specified project using the +// data included in the request. // // - project: Project ID for this request. -// - zone: The name of the zone for this request. -func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall { - c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *NodeTemplatesService) Insert(project string, region string, nodetemplate *NodeTemplate) *NodeTemplatesInsertCall { + c := &NodeTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.zone = zone - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *NodeTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTypesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + c.region = region + c.nodetemplate = nodetemplate return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *NodeTemplatesInsertCall) RequestId(requestId string) *NodeTemplatesInsertCall { + c.urlParams_.Set("requestId", requestId) return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall { - c.ifNoneMatch_ = entityTag +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NodeTemplatesInsertCall) Fields(s ...googleapi.Field) *NodeTemplatesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall { +func (c *NodeTemplatesInsertCall) Context(ctx context.Context) *NodeTemplatesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *NodeTypesListCall) Header() http.Header { +func (c *NodeTemplatesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *NodeTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.nodetemplate) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "zone": c.zone, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.nodeTypes.list" call. +// Do executes the "compute.nodeTemplates.insert" call. // Any non-2xx status code is an error. Response headers are in either -// *NodeTypeList.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) { +func (c *NodeTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -52641,7 +52550,7 @@ func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &NodeTypeList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -52654,44 +52563,24 @@ func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, err return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type PacketMirroringsAggregatedListCall struct { +type NodeTemplatesListCall struct { s *Service project string + region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves an aggregated list of packetMirrorings. To prevent -// failure, Google recommends that you set the `returnPartialSuccess` parameter -// to `true`. +// List: Retrieves a list of node templates available to the specified project. // // - project: Project ID for this request. -func (r *PacketMirroringsService) AggregatedList(project string) *PacketMirroringsAggregatedListCall { - c := &PacketMirroringsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *NodeTemplatesService) List(project string, region string) *NodeTemplatesListCall { + c := &NodeTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region return c } @@ -52727,30 +52616,17 @@ func (r *PacketMirroringsService) AggregatedList(project string) *PacketMirrorin // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *PacketMirroringsAggregatedListCall) Filter(filter string) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) Filter(filter string) *NodeTemplatesListCall { c.urlParams_.Set("filter", filter) return c } -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *PacketMirroringsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *PacketMirroringsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *PacketMirroringsAggregatedListCall) MaxResults(maxResults int64) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) MaxResults(maxResults int64) *NodeTemplatesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -52763,7 +52639,7 @@ func (c *PacketMirroringsAggregatedListCall) MaxResults(maxResults int64) *Packe // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *PacketMirroringsAggregatedListCall) OrderBy(orderBy string) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) OrderBy(orderBy string) *NodeTemplatesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -52771,7 +52647,7 @@ func (c *PacketMirroringsAggregatedListCall) OrderBy(orderBy string) *PacketMirr // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *PacketMirroringsAggregatedListCall) PageToken(pageToken string) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) PageToken(pageToken string) *NodeTemplatesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -52781,23 +52657,15 @@ func (c *PacketMirroringsAggregatedListCall) PageToken(pageToken string) *Packet // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *PacketMirroringsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTemplatesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *PacketMirroringsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *PacketMirroringsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PacketMirroringsAggregatedListCall) Fields(s ...googleapi.Field) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) Fields(s ...googleapi.Field) *NodeTemplatesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -52805,27 +52673,27 @@ func (c *PacketMirroringsAggregatedListCall) Fields(s ...googleapi.Field) *Packe // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *PacketMirroringsAggregatedListCall) IfNoneMatch(entityTag string) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) IfNoneMatch(entityTag string) *NodeTemplatesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsAggregatedListCall) Context(ctx context.Context) *PacketMirroringsAggregatedListCall { +func (c *NodeTemplatesListCall) Context(ctx context.Context) *NodeTemplatesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PacketMirroringsAggregatedListCall) Header() http.Header { +func (c *NodeTemplatesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeTemplatesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -52833,7 +52701,7 @@ func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Respon var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/packetMirrorings") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -52842,17 +52710,18 @@ func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Respon req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.packetMirrorings.aggregatedList" call. +// Do executes the "compute.nodeTemplates.list" call. // Any non-2xx status code is an error. Response headers are in either -// *PacketMirroringAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *PacketMirroringsAggregatedListCall) Do(opts ...googleapi.CallOption) (*PacketMirroringAggregatedList, error) { +// *NodeTemplateList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *NodeTemplatesListCall) Do(opts ...googleapi.CallOption) (*NodeTemplateList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -52871,7 +52740,7 @@ func (c *PacketMirroringsAggregatedListCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PacketMirroringAggregatedList{ + ret := &NodeTemplateList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -52887,7 +52756,7 @@ func (c *PacketMirroringsAggregatedListCall) Do(opts ...googleapi.CallOption) (* // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *PacketMirroringsAggregatedListCall) Pages(ctx context.Context, f func(*PacketMirroringAggregatedList) error) error { +func (c *NodeTemplatesListCall) Pages(ctx context.Context, f func(*NodeTemplateList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -52905,93 +52774,196 @@ func (c *PacketMirroringsAggregatedListCall) Pages(ctx context.Context, f func(* } } -type PacketMirroringsDeleteCall struct { - s *Service - project string - region string - packetMirroring string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type NodeTemplatesSetIamPolicyCall struct { + s *Service + project string + region string + resource string + regionsetpolicyrequest *RegionSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. +// +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *NodeTemplatesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *NodeTemplatesSetIamPolicyCall { + c := &NodeTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.resource = resource + c.regionsetpolicyrequest = regionsetpolicyrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *NodeTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *NodeTemplatesSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *NodeTemplatesSetIamPolicyCall) Context(ctx context.Context) *NodeTemplatesSetIamPolicyCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *NodeTemplatesSetIamPolicyCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *NodeTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.nodeTemplates.setIamPolicy" call. +// Any non-2xx status code is an error. Response headers are in either +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *NodeTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Policy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type NodeTemplatesTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified PacketMirroring resource. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // -// - packetMirroring: Name of the PacketMirroring resource to delete. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *PacketMirroringsService) Delete(project string, region string, packetMirroring string) *PacketMirroringsDeleteCall { - c := &PacketMirroringsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *NodeTemplatesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *NodeTemplatesTestIamPermissionsCall { + c := &NodeTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.packetMirroring = packetMirroring - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *PacketMirroringsDeleteCall) RequestId(requestId string) *PacketMirroringsDeleteCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PacketMirroringsDeleteCall) Fields(s ...googleapi.Field) *PacketMirroringsDeleteCall { +func (c *NodeTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *NodeTemplatesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsDeleteCall) Context(ctx context.Context) *PacketMirroringsDeleteCall { +func (c *NodeTemplatesTestIamPermissionsCall) Context(ctx context.Context) *NodeTemplatesTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PacketMirroringsDeleteCall) Header() http.Header { +func (c *NodeTemplatesTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PacketMirroringsDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *NodeTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "packetMirroring": c.packetMirroring, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.packetMirrorings.delete" call. +// Do executes the "compute.nodeTemplates.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *PacketMirroringsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *NodeTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53010,7 +52982,7 @@ func (c *PacketMirroringsDeleteCall) Do(opts ...googleapi.CallOption) (*Operatio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -53023,34 +52995,129 @@ func (c *PacketMirroringsDeleteCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type PacketMirroringsGetCall struct { - s *Service - project string - region string - packetMirroring string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type NodeTypesAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified PacketMirroring resource. +// AggregatedList: Retrieves an aggregated list of node types. To prevent +// failure, Google recommends that you set the `returnPartialSuccess` parameter +// to `true`. // -// - packetMirroring: Name of the PacketMirroring resource to return. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *PacketMirroringsService) Get(project string, region string, packetMirroring string) *PacketMirroringsGetCall { - c := &PacketMirroringsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *NodeTypesService) AggregatedList(project string) *NodeTypesAggregatedListCall { + c := &NodeTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.packetMirroring = packetMirroring + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *NodeTypesAggregatedListCall) Filter(filter string) *NodeTypesAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *NodeTypesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *NodeTypesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *NodeTypesAggregatedListCall) MaxResults(maxResults int64) *NodeTypesAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *NodeTypesAggregatedListCall) OrderBy(orderBy string) *NodeTypesAggregatedListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *NodeTypesAggregatedListCall) PageToken(pageToken string) *NodeTypesAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *NodeTypesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTypesAggregatedListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *NodeTypesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *NodeTypesAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PacketMirroringsGetCall) Fields(s ...googleapi.Field) *PacketMirroringsGetCall { +func (c *NodeTypesAggregatedListCall) Fields(s ...googleapi.Field) *NodeTypesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -53058,27 +53125,27 @@ func (c *PacketMirroringsGetCall) Fields(s ...googleapi.Field) *PacketMirrorings // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *PacketMirroringsGetCall) IfNoneMatch(entityTag string) *PacketMirroringsGetCall { +func (c *NodeTypesAggregatedListCall) IfNoneMatch(entityTag string) *NodeTypesAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsGetCall) Context(ctx context.Context) *PacketMirroringsGetCall { +func (c *NodeTypesAggregatedListCall) Context(ctx context.Context) *NodeTypesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PacketMirroringsGetCall) Header() http.Header { +func (c *NodeTypesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *NodeTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -53086,7 +53153,7 @@ func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/nodeTypes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -53094,20 +53161,18 @@ func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "packetMirroring": c.packetMirroring, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.packetMirrorings.get" call. +// Do executes the "compute.nodeTypes.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *PacketMirroring.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// *NodeTypeAggregatedList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to // check whether the returned error was because http.StatusNotModified was // returned. -func (c *PacketMirroringsGetCall) Do(opts ...googleapi.CallOption) (*PacketMirroring, error) { +func (c *NodeTypesAggregatedListCall) Do(opts ...googleapi.CallOption) (*NodeTypeAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53126,7 +53191,7 @@ func (c *PacketMirroringsGetCall) Do(opts ...googleapi.CallOption) (*PacketMirro if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PacketMirroring{ + ret := &NodeTypeAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -53139,96 +53204,111 @@ func (c *PacketMirroringsGetCall) Do(opts ...googleapi.CallOption) (*PacketMirro return ret, nil } -type PacketMirroringsInsertCall struct { - s *Service - project string - region string - packetmirroring *PacketMirroring - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NodeTypesAggregatedListCall) Pages(ctx context.Context, f func(*NodeTypeAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type NodeTypesGetCall struct { + s *Service + project string + zone string + nodeType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Insert: Creates a PacketMirroring resource in the specified project and -// region using the data included in the request. +// Get: Returns the specified node type. // +// - nodeType: Name of the node type to return. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *PacketMirroringsService) Insert(project string, region string, packetmirroring *PacketMirroring) *PacketMirroringsInsertCall { - c := &PacketMirroringsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *NodeTypesService) Get(project string, zone string, nodeType string) *NodeTypesGetCall { + c := &NodeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.packetmirroring = packetmirroring - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *PacketMirroringsInsertCall) RequestId(requestId string) *PacketMirroringsInsertCall { - c.urlParams_.Set("requestId", requestId) + c.zone = zone + c.nodeType = nodeType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PacketMirroringsInsertCall) Fields(s ...googleapi.Field) *PacketMirroringsInsertCall { +func (c *NodeTypesGetCall) Fields(s ...googleapi.Field) *NodeTypesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NodeTypesGetCall) IfNoneMatch(entityTag string) *NodeTypesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsInsertCall) Context(ctx context.Context) *PacketMirroringsInsertCall { +func (c *NodeTypesGetCall) Context(ctx context.Context) *NodeTypesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PacketMirroringsInsertCall) Header() http.Header { +func (c *NodeTypesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PacketMirroringsInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) - if err != nil { - return nil, err +func (c *NodeTypesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes/{nodeType}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "zone": c.zone, + "nodeType": c.nodeType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.packetMirrorings.insert" call. +// Do executes the "compute.nodeTypes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *NodeType.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PacketMirroringsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeTypesGetCall) Do(opts ...googleapi.CallOption) (*NodeType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53247,7 +53327,7 @@ func (c *PacketMirroringsInsertCall) Do(opts ...googleapi.CallOption) (*Operatio if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NodeType{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -53260,25 +53340,24 @@ func (c *PacketMirroringsInsertCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type PacketMirroringsListCall struct { +type NodeTypesListCall struct { s *Service project string - region string + zone string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of PacketMirroring resources available to the -// specified project and region. +// List: Retrieves a list of node types available to the specified project. // // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *PacketMirroringsService) List(project string, region string) *PacketMirroringsListCall { - c := &PacketMirroringsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - zone: The name of the zone for this request. +func (r *NodeTypesService) List(project string, zone string) *NodeTypesListCall { + c := &NodeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region + c.zone = zone return c } @@ -53314,7 +53393,7 @@ func (r *PacketMirroringsService) List(project string, region string) *PacketMir // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *PacketMirroringsListCall) Filter(filter string) *PacketMirroringsListCall { +func (c *NodeTypesListCall) Filter(filter string) *NodeTypesListCall { c.urlParams_.Set("filter", filter) return c } @@ -53324,7 +53403,7 @@ func (c *PacketMirroringsListCall) Filter(filter string) *PacketMirroringsListCa // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *PacketMirroringsListCall) MaxResults(maxResults int64) *PacketMirroringsListCall { +func (c *NodeTypesListCall) MaxResults(maxResults int64) *NodeTypesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -53337,7 +53416,7 @@ func (c *PacketMirroringsListCall) MaxResults(maxResults int64) *PacketMirroring // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *PacketMirroringsListCall) OrderBy(orderBy string) *PacketMirroringsListCall { +func (c *NodeTypesListCall) OrderBy(orderBy string) *NodeTypesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -53345,7 +53424,7 @@ func (c *PacketMirroringsListCall) OrderBy(orderBy string) *PacketMirroringsList // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *PacketMirroringsListCall) PageToken(pageToken string) *PacketMirroringsListCall { +func (c *NodeTypesListCall) PageToken(pageToken string) *NodeTypesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -53355,7 +53434,7 @@ func (c *PacketMirroringsListCall) PageToken(pageToken string) *PacketMirrorings // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *PacketMirroringsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PacketMirroringsListCall { +func (c *NodeTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *NodeTypesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -53363,210 +53442,62 @@ func (c *PacketMirroringsListCall) ReturnPartialSuccess(returnPartialSuccess boo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PacketMirroringsListCall) Fields(s ...googleapi.Field) *PacketMirroringsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *PacketMirroringsListCall) IfNoneMatch(entityTag string) *PacketMirroringsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsListCall) Context(ctx context.Context) *PacketMirroringsListCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *PacketMirroringsListCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *PacketMirroringsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.packetMirrorings.list" call. -// Any non-2xx status code is an error. Response headers are in either -// *PacketMirroringList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *PacketMirroringsListCall) Do(opts ...googleapi.CallOption) (*PacketMirroringList, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &PacketMirroringList{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *PacketMirroringsListCall) Pages(ctx context.Context, f func(*PacketMirroringList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type PacketMirroringsPatchCall struct { - s *Service - project string - region string - packetMirroring string - packetmirroring *PacketMirroring - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches the specified PacketMirroring resource with the data included -// in the request. This method supports PATCH semantics and uses JSON merge -// patch format and processing rules. -// -// - packetMirroring: Name of the PacketMirroring resource to patch. -// - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *PacketMirroringsService) Patch(project string, region string, packetMirroring string, packetmirroring *PacketMirroring) *PacketMirroringsPatchCall { - c := &PacketMirroringsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.packetMirroring = packetMirroring - c.packetmirroring = packetmirroring - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *PacketMirroringsPatchCall) RequestId(requestId string) *PacketMirroringsPatchCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *PacketMirroringsPatchCall) Fields(s ...googleapi.Field) *PacketMirroringsPatchCall { +func (c *NodeTypesListCall) Fields(s ...googleapi.Field) *NodeTypesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *NodeTypesListCall) IfNoneMatch(entityTag string) *NodeTypesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsPatchCall) Context(ctx context.Context) *PacketMirroringsPatchCall { +func (c *NodeTypesListCall) Context(ctx context.Context) *NodeTypesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PacketMirroringsPatchCall) Header() http.Header { +func (c *NodeTypesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PacketMirroringsPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) - if err != nil { - return nil, err +func (c *NodeTypesListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/zones/{zone}/nodeTypes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "packetMirroring": c.packetMirroring, + "project": c.project, + "zone": c.zone, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.packetMirrorings.patch" call. +// Do executes the "compute.nodeTypes.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *NodeTypeList.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PacketMirroringsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *NodeTypesListCall) Do(opts ...googleapi.CallOption) (*NodeTypeList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53585,7 +53516,7 @@ func (c *PacketMirroringsPatchCall) Do(opts ...googleapi.CallOption) (*Operation if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &NodeTypeList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -53598,86 +53529,205 @@ func (c *PacketMirroringsPatchCall) Do(opts ...googleapi.CallOption) (*Operation return ret, nil } -type PacketMirroringsTestIamPermissionsCall struct { - s *Service - project string - region string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *NodeTypesListCall) Pages(ctx context.Context, f func(*NodeTypeList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +type PacketMirroringsAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// AggregatedList: Retrieves an aggregated list of packetMirrorings. To prevent +// failure, Google recommends that you set the `returnPartialSuccess` parameter +// to `true`. // // - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *PacketMirroringsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *PacketMirroringsTestIamPermissionsCall { - c := &PacketMirroringsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *PacketMirroringsService) AggregatedList(project string) *PacketMirroringsAggregatedListCall { + c := &PacketMirroringsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *PacketMirroringsAggregatedListCall) Filter(filter string) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *PacketMirroringsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *PacketMirroringsAggregatedListCall) MaxResults(maxResults int64) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *PacketMirroringsAggregatedListCall) OrderBy(orderBy string) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *PacketMirroringsAggregatedListCall) PageToken(pageToken string) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *PacketMirroringsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *PacketMirroringsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *PacketMirroringsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PacketMirroringsTestIamPermissionsCall) Fields(s ...googleapi.Field) *PacketMirroringsTestIamPermissionsCall { +func (c *PacketMirroringsAggregatedListCall) Fields(s ...googleapi.Field) *PacketMirroringsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *PacketMirroringsAggregatedListCall) IfNoneMatch(entityTag string) *PacketMirroringsAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *PacketMirroringsTestIamPermissionsCall) Context(ctx context.Context) *PacketMirroringsTestIamPermissionsCall { +func (c *PacketMirroringsAggregatedListCall) Context(ctx context.Context) *PacketMirroringsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PacketMirroringsTestIamPermissionsCall) Header() http.Header { +func (c *PacketMirroringsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PacketMirroringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err +func (c *PacketMirroringsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.packetMirrorings.testIamPermissions" call. +// Do executes the "compute.packetMirrorings.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// *PacketMirroringAggregatedList.ServerResponse.Header or (if a response was // returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *PacketMirroringsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +func (c *PacketMirroringsAggregatedListCall) Do(opts ...googleapi.CallOption) (*PacketMirroringAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53696,7 +53746,7 @@ func (c *PacketMirroringsTestIamPermissionsCall) Do(opts ...googleapi.CallOption if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &PacketMirroringAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -53709,20 +53759,47 @@ func (c *PacketMirroringsTestIamPermissionsCall) Do(opts ...googleapi.CallOption return ret, nil } -type ProjectsDisableXpnHostCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *PacketMirroringsAggregatedListCall) Pages(ctx context.Context, f func(*PacketMirroringAggregatedList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// DisableXpnHost: Disable this project as a shared VPC host project. +type PacketMirroringsDeleteCall struct { + s *Service + project string + region string + packetMirroring string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Delete: Deletes the specified PacketMirroring resource. // +// - packetMirroring: Name of the PacketMirroring resource to delete. // - project: Project ID for this request. -func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall { - c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *PacketMirroringsService) Delete(project string, region string, packetMirroring string) *PacketMirroringsDeleteCall { + c := &PacketMirroringsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region + c.packetMirroring = packetMirroring return c } @@ -53736,7 +53813,7 @@ func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHost // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall { +func (c *PacketMirroringsDeleteCall) RequestId(requestId string) *PacketMirroringsDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -53744,50 +53821,52 @@ func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisabl // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall { +func (c *PacketMirroringsDeleteCall) Fields(s ...googleapi.Field) *PacketMirroringsDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall { +func (c *PacketMirroringsDeleteCall) Context(ctx context.Context) *PacketMirroringsDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDisableXpnHostCall) Header() http.Header { +func (c *PacketMirroringsDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) { +func (c *PacketMirroringsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnHost") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "region": c.region, + "packetMirroring": c.packetMirroring, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.disableXpnHost" call. +// Do executes the "compute.packetMirrorings.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PacketMirroringsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53819,92 +53898,91 @@ func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type ProjectsDisableXpnResourceCall struct { - s *Service - project string - projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PacketMirroringsGetCall struct { + s *Service + project string + region string + packetMirroring string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// DisableXpnResource: Disable a service resource (also known as service -// project) associated with this host project. +// Get: Returns the specified PacketMirroring resource. // +// - packetMirroring: Name of the PacketMirroring resource to return. // - project: Project ID for this request. -func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall { - c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *PacketMirroringsService) Get(project string, region string, packetMirroring string) *PacketMirroringsGetCall { + c := &PacketMirroringsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall { - c.urlParams_.Set("requestId", requestId) + c.region = region + c.packetMirroring = packetMirroring return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall { +func (c *PacketMirroringsGetCall) Fields(s ...googleapi.Field) *PacketMirroringsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *PacketMirroringsGetCall) IfNoneMatch(entityTag string) *PacketMirroringsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall { +func (c *PacketMirroringsGetCall) Context(ctx context.Context) *PacketMirroringsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsDisableXpnResourceCall) Header() http.Header { +func (c *PacketMirroringsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest) - if err != nil { - return nil, err +func (c *PacketMirroringsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnResource") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "region": c.region, + "packetMirroring": c.packetMirroring, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.disableXpnResource" call. +// Do executes the "compute.packetMirrorings.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *PacketMirroring.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *PacketMirroringsGetCall) Do(opts ...googleapi.CallOption) (*PacketMirroring, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -53923,7 +54001,7 @@ func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Oper if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &PacketMirroring{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -53936,20 +54014,26 @@ func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type ProjectsEnableXpnHostCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PacketMirroringsInsertCall struct { + s *Service + project string + region string + packetmirroring *PacketMirroring + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// EnableXpnHost: Enable this project as a shared VPC host project. +// Insert: Creates a PacketMirroring resource in the specified project and +// region using the data included in the request. // // - project: Project ID for this request. -func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall { - c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *PacketMirroringsService) Insert(project string, region string, packetmirroring *PacketMirroring) *PacketMirroringsInsertCall { + c := &PacketMirroringsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region + c.packetmirroring = packetmirroring return c } @@ -53963,7 +54047,7 @@ func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCa // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall { +func (c *PacketMirroringsInsertCall) RequestId(requestId string) *PacketMirroringsInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -53971,32 +54055,36 @@ func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableX // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall { +func (c *PacketMirroringsInsertCall) Fields(s ...googleapi.Field) *PacketMirroringsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall { +func (c *PacketMirroringsInsertCall) Context(ctx context.Context) *PacketMirroringsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsEnableXpnHostCall) Header() http.Header { +func (c *PacketMirroringsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *PacketMirroringsInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnHost") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -54005,16 +54093,17 @@ func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.enableXpnHost" call. +// Do executes the "compute.packetMirrorings.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PacketMirroringsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54046,93 +54135,166 @@ func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation return ret, nil } -type ProjectsEnableXpnResourceCall struct { - s *Service - project string - projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PacketMirroringsListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves a list of PacketMirroring resources available to the +// specified project and region. +// +// - project: Project ID for this request. +// - region: Name of the region for this request. +func (r *PacketMirroringsService) List(project string, region string) *PacketMirroringsListCall { + c := &PacketMirroringsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *PacketMirroringsListCall) Filter(filter string) *PacketMirroringsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *PacketMirroringsListCall) MaxResults(maxResults int64) *PacketMirroringsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *PacketMirroringsListCall) OrderBy(orderBy string) *PacketMirroringsListCall { + c.urlParams_.Set("orderBy", orderBy) + return c } -// EnableXpnResource: Enable service resource (a.k.a service project) for a -// host project, so that subnets in the host project can be used by instances -// in the service project. -// -// - project: Project ID for this request. -func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall { - c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *PacketMirroringsListCall) PageToken(pageToken string) *PacketMirroringsListCall { + c.urlParams_.Set("pageToken", pageToken) return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall { - c.urlParams_.Set("requestId", requestId) +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *PacketMirroringsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PacketMirroringsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall { +func (c *PacketMirroringsListCall) Fields(s ...googleapi.Field) *PacketMirroringsListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *PacketMirroringsListCall) IfNoneMatch(entityTag string) *PacketMirroringsListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall { +func (c *PacketMirroringsListCall) Context(ctx context.Context) *PacketMirroringsListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsEnableXpnResourceCall) Header() http.Header { +func (c *PacketMirroringsListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest) - if err != nil { - return nil, err +func (c *PacketMirroringsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnResource") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.enableXpnResource" call. +// Do executes the "compute.packetMirrorings.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *PacketMirroringList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *PacketMirroringsListCall) Do(opts ...googleapi.CallOption) (*PacketMirroringList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54151,7 +54313,7 @@ func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Opera if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &PacketMirroringList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -54164,88 +54326,122 @@ func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Opera return ret, nil } -type ProjectsGetCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *PacketMirroringsListCall) Pages(ctx context.Context, f func(*PacketMirroringList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Get: Returns the specified Project resource. To decrease latency for this -// method, you can optionally omit any unneeded information from the response -// by using a field mask. This practice is especially recommended for unused -// quota information (the `quotas` field). To exclude one or more fields, set -// your request's `fields` query parameter to only include the fields you need. -// For example, to only include the `id` and `selfLink` fields, add the query -// parameter `?fields=id,selfLink` to your request. +type PacketMirroringsPatchCall struct { + s *Service + project string + region string + packetMirroring string + packetmirroring *PacketMirroring + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Patches the specified PacketMirroring resource with the data included +// in the request. This method supports PATCH semantics and uses JSON merge +// patch format and processing rules. // +// - packetMirroring: Name of the PacketMirroring resource to patch. // - project: Project ID for this request. -func (r *ProjectsService) Get(project string) *ProjectsGetCall { - c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *PacketMirroringsService) Patch(project string, region string, packetMirroring string, packetmirroring *PacketMirroring) *PacketMirroringsPatchCall { + c := &PacketMirroringsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region + c.packetMirroring = packetMirroring + c.packetmirroring = packetmirroring + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PacketMirroringsPatchCall) RequestId(requestId string) *PacketMirroringsPatchCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { +func (c *PacketMirroringsPatchCall) Fields(s ...googleapi.Field) *PacketMirroringsPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { +func (c *PacketMirroringsPatchCall) Context(ctx context.Context) *PacketMirroringsPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsGetCall) Header() http.Header { +func (c *PacketMirroringsPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *PacketMirroringsPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.packetmirroring) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{packetMirroring}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "region": c.region, + "packetMirroring": c.packetMirroring, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.get" call. +// Do executes the "compute.packetMirrorings.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *Project.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { +func (c *PacketMirroringsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54264,7 +54460,7 @@ func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Project{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -54277,83 +54473,86 @@ func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { return ret, nil } -type ProjectsGetXpnHostCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type PacketMirroringsTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetXpnHost: Gets the shared VPC host project that this project links to. May -// be empty if no link exists. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // // - project: Project ID for this request. -func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall { - c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *PacketMirroringsService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *PacketMirroringsTestIamPermissionsCall { + c := &PacketMirroringsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall { +func (c *PacketMirroringsTestIamPermissionsCall) Fields(s ...googleapi.Field) *PacketMirroringsTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall { +func (c *PacketMirroringsTestIamPermissionsCall) Context(ctx context.Context) *PacketMirroringsTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsGetXpnHostCall) Header() http.Header { +func (c *PacketMirroringsTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *PacketMirroringsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnHost") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/packetMirrorings/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.getXpnHost" call. +// Do executes the "compute.packetMirrorings.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Project.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PacketMirroringsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54372,7 +54571,7 @@ func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, err if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Project{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -54385,145 +54584,69 @@ func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, err return ret, nil } -type ProjectsGetXpnResourcesCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsDisableXpnHostCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetXpnResources: Gets service resources (a.k.a service project) associated -// with this host project. +// DisableXpnHost: Disable this project as a shared VPC host project. // // - project: Project ID for this request. -func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall { - c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) DisableXpnHost(project string) *ProjectsDisableXpnHostCall { + c := &ProjectsDisableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *ProjectsGetXpnResourcesCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsGetXpnResourcesCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *ProjectsDisableXpnHostCall) RequestId(requestId string) *ProjectsDisableXpnHostCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall { +func (c *ProjectsDisableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnHostCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall { +func (c *ProjectsDisableXpnHostCall) Context(ctx context.Context) *ProjectsDisableXpnHostCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsGetXpnResourcesCall) Header() http.Header { +func (c *ProjectsDisableXpnHostCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDisableXpnHostCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnResources") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -54534,13 +54657,12 @@ func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.getXpnResources" call. +// Do executes the "compute.projects.disableXpnHost" call. // Any non-2xx status code is an error. Response headers are in either -// *ProjectsGetXpnResources.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsDisableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54559,171 +54681,87 @@ func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*Project if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &ProjectsGetXpnResources{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsListXpnHostsCall struct { - s *Service - project string - projectslistxpnhostsrequest *ProjectsListXpnHostsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// ListXpnHosts: Lists all shared VPC host projects visible to the user in an -// organization. -// -// - project: Project ID for this request. -func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall { - c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.projectslistxpnhostsrequest = projectslistxpnhostsrequest - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil } -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall { - c.urlParams_.Set("orderBy", orderBy) - return c +type ProjectsDisableXpnResourceCall struct { + s *Service + project string + projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall { - c.urlParams_.Set("pageToken", pageToken) +// DisableXpnResource: Disable a service resource (also known as service +// project) associated with this host project. +// +// - project: Project ID for this request. +func (r *ProjectsService) DisableXpnResource(project string, projectsdisablexpnresourcerequest *ProjectsDisableXpnResourceRequest) *ProjectsDisableXpnResourceCall { + c := &ProjectsDisableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.projectsdisablexpnresourcerequest = projectsdisablexpnresourcerequest return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *ProjectsListXpnHostsCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsListXpnHostsCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *ProjectsDisableXpnResourceCall) RequestId(requestId string) *ProjectsDisableXpnResourceCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall { +func (c *ProjectsDisableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsDisableXpnResourceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall { +func (c *ProjectsDisableXpnResourceCall) Context(ctx context.Context) *ProjectsDisableXpnResourceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsListXpnHostsCall) Header() http.Header { +func (c *ProjectsDisableXpnResourceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsDisableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsdisablexpnresourcerequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/listXpnHosts") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/disableXpnResource") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -54736,12 +54774,12 @@ func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.listXpnHosts" call. +// Do executes the "compute.projects.disableXpnResource" call. // Any non-2xx status code is an error. Response headers are in either -// *XpnHostList.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) { +func (c *ProjectsDisableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54760,7 +54798,7 @@ func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostLis if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &XpnHostList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -54773,43 +54811,20 @@ func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostLis return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type ProjectsMoveDiskCall struct { - s *Service - project string - diskmoverequest *DiskMoveRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsEnableXpnHostCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// MoveDisk: Moves a persistent disk from one zone to another. +// EnableXpnHost: Enable this project as a shared VPC host project. // // - project: Project ID for this request. -func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall { - c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) EnableXpnHost(project string) *ProjectsEnableXpnHostCall { + c := &ProjectsEnableXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.diskmoverequest = diskmoverequest return c } @@ -54823,7 +54838,7 @@ func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequ // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall { +func (c *ProjectsEnableXpnHostCall) RequestId(requestId string) *ProjectsEnableXpnHostCall { c.urlParams_.Set("requestId", requestId) return c } @@ -54831,36 +54846,32 @@ func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall { +func (c *ProjectsEnableXpnHostCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnHostCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall { +func (c *ProjectsEnableXpnHostCall) Context(ctx context.Context) *ProjectsEnableXpnHostCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsMoveDiskCall) Header() http.Header { +func (c *ProjectsEnableXpnHostCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *ProjectsEnableXpnHostCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/moveDisk") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnHost") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -54873,12 +54884,12 @@ func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.moveDisk" call. +// Do executes the "compute.projects.enableXpnHost" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsEnableXpnHostCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -54910,28 +54921,24 @@ func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, err return ret, nil } -type ProjectsMoveInstanceCall struct { - s *Service - project string - instancemoverequest *InstanceMoveRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsEnableXpnResourceCall struct { + s *Service + project string + projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// MoveInstance: Moves an instance and its attached persistent disks from one -// zone to another. *Note*: Moving VMs or disks by using this method might -// cause unexpected behavior. For more information, see the known issue -// (/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_mov -// einstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method -// is deprecated. See moving instance across zones -// (/compute/docs/instances/moving-instance-across-zones) instead. +// EnableXpnResource: Enable service resource (a.k.a service project) for a +// host project, so that subnets in the host project can be used by instances +// in the service project. // // - project: Project ID for this request. -func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall { - c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) EnableXpnResource(project string, projectsenablexpnresourcerequest *ProjectsEnableXpnResourceRequest) *ProjectsEnableXpnResourceCall { + c := &ProjectsEnableXpnResourceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.instancemoverequest = instancemoverequest + c.projectsenablexpnresourcerequest = projectsenablexpnresourcerequest return c } @@ -54945,7 +54952,7 @@ func (r *ProjectsService) MoveInstance(project string, instancemoverequest *Inst // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall { +func (c *ProjectsEnableXpnResourceCall) RequestId(requestId string) *ProjectsEnableXpnResourceCall { c.urlParams_.Set("requestId", requestId) return c } @@ -54953,36 +54960,36 @@ func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInst // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall { +func (c *ProjectsEnableXpnResourceCall) Fields(s ...googleapi.Field) *ProjectsEnableXpnResourceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall { +func (c *ProjectsEnableXpnResourceCall) Context(ctx context.Context) *ProjectsEnableXpnResourceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsMoveInstanceCall) Header() http.Header { +func (c *ProjectsEnableXpnResourceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsEnableXpnResourceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectsenablexpnresourcerequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/moveInstance") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/enableXpnResource") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -54995,12 +55002,12 @@ func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.moveInstance" call. +// Do executes the "compute.projects.enableXpnResource" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsEnableXpnResourceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55032,78 +55039,72 @@ func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type ProjectsSetCloudArmorTierCall struct { - s *Service - project string - projectssetcloudarmortierrequest *ProjectsSetCloudArmorTierRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsGetCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetCloudArmorTier: Sets the Cloud Armor tier of the project. To set -// ENTERPRISE or above the billing account of the project must be subscribed to -// Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more -// information. +// Get: Returns the specified Project resource. To decrease latency for this +// method, you can optionally omit any unneeded information from the response +// by using a field mask. This practice is especially recommended for unused +// quota information (the `quotas` field). To exclude one or more fields, set +// your request's `fields` query parameter to only include the fields you need. +// For example, to only include the `id` and `selfLink` fields, add the query +// parameter `?fields=id,selfLink` to your request. // // - project: Project ID for this request. -func (r *ProjectsService) SetCloudArmorTier(project string, projectssetcloudarmortierrequest *ProjectsSetCloudArmorTierRequest) *ProjectsSetCloudArmorTierCall { - c := &ProjectsSetCloudArmorTierCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) Get(project string) *ProjectsGetCall { + c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.projectssetcloudarmortierrequest = projectssetcloudarmortierrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsSetCloudArmorTierCall) RequestId(requestId string) *ProjectsSetCloudArmorTierCall { - c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsSetCloudArmorTierCall) Fields(s ...googleapi.Field) *ProjectsSetCloudArmorTierCall { +func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsSetCloudArmorTierCall) Context(ctx context.Context) *ProjectsSetCloudArmorTierCall { +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsSetCloudArmorTierCall) Header() http.Header { +func (c *ProjectsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsSetCloudArmorTierCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetcloudarmortierrequest) - if err != nil { - return nil, err +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setCloudArmorTier") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -55114,12 +55115,12 @@ func (c *ProjectsSetCloudArmorTierCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.setCloudArmorTier" call. +// Do executes the "compute.projects.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Project.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsSetCloudArmorTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55138,7 +55139,7 @@ func (c *ProjectsSetCloudArmorTierCall) Do(opts ...googleapi.CallOption) (*Opera if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Project{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -55151,76 +55152,67 @@ func (c *ProjectsSetCloudArmorTierCall) Do(opts ...googleapi.CallOption) (*Opera return ret, nil } -type ProjectsSetCommonInstanceMetadataCall struct { - s *Service - project string - metadata *Metadata - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsGetXpnHostCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetCommonInstanceMetadata: Sets metadata common to all instances within the -// specified project using the data included in the request. +// GetXpnHost: Gets the shared VPC host project that this project links to. May +// be empty if no link exists. // // - project: Project ID for this request. -func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { - c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) GetXpnHost(project string) *ProjectsGetXpnHostCall { + c := &ProjectsGetXpnHostCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.metadata = metadata - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall { - c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall { +func (c *ProjectsGetXpnHostCall) Fields(s ...googleapi.Field) *ProjectsGetXpnHostCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsGetXpnHostCall) IfNoneMatch(entityTag string) *ProjectsGetXpnHostCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall { +func (c *ProjectsGetXpnHostCall) Context(ctx context.Context) *ProjectsGetXpnHostCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header { +func (c *ProjectsGetXpnHostCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) - if err != nil { - return nil, err +func (c *ProjectsGetXpnHostCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setCommonInstanceMetadata") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnHost") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -55231,12 +55223,12 @@ func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.setCommonInstanceMetadata" call. +// Do executes the "compute.projects.getXpnHost" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Project.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsGetXpnHostCall) Do(opts ...googleapi.CallOption) (*Project, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55255,7 +55247,7 @@ func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Project{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -55268,77 +55260,145 @@ func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) return ret, nil } -type ProjectsSetDefaultNetworkTierCall struct { - s *Service - project string - projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsGetXpnResourcesCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetDefaultNetworkTier: Sets the default network tier of the project. The -// default network tier is used when an address/forwardingRule/instance is -// created without specifying the network tier field. +// GetXpnResources: Gets service resources (a.k.a service project) associated +// with this host project. // // - project: Project ID for this request. -func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall { - c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) GetXpnResources(project string) *ProjectsGetXpnResourcesCall { + c := &ProjectsGetXpnResourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *ProjectsGetXpnResourcesCall) Filter(filter string) *ProjectsGetXpnResourcesCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *ProjectsGetXpnResourcesCall) MaxResults(maxResults int64) *ProjectsGetXpnResourcesCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *ProjectsGetXpnResourcesCall) OrderBy(orderBy string) *ProjectsGetXpnResourcesCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *ProjectsGetXpnResourcesCall) PageToken(pageToken string) *ProjectsGetXpnResourcesCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *ProjectsGetXpnResourcesCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsGetXpnResourcesCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall { +func (c *ProjectsGetXpnResourcesCall) Fields(s ...googleapi.Field) *ProjectsGetXpnResourcesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsGetXpnResourcesCall) IfNoneMatch(entityTag string) *ProjectsGetXpnResourcesCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall { +func (c *ProjectsGetXpnResourcesCall) Context(ctx context.Context) *ProjectsGetXpnResourcesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header { +func (c *ProjectsGetXpnResourcesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest) - if err != nil { - return nil, err +func (c *ProjectsGetXpnResourcesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setDefaultNetworkTier") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/getXpnResources") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -55349,12 +55409,13 @@ func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.setDefaultNetworkTier" call. +// Do executes the "compute.projects.getXpnResources" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *ProjectsGetXpnResources.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ProjectsGetXpnResourcesCall) Do(opts ...googleapi.CallOption) (*ProjectsGetXpnResources, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55373,7 +55434,7 @@ func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &ProjectsGetXpnResources{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -55383,78 +55444,161 @@ func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*O if err := gensupport.DecodeResponse(target, res); err != nil { return nil, err } - return ret, nil + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsGetXpnResourcesCall) Pages(ctx context.Context, f func(*ProjectsGetXpnResources) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -type ProjectsSetUsageExportBucketCall struct { - s *Service - project string - usageexportlocation *UsageExportLocation - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsListXpnHostsCall struct { + s *Service + project string + projectslistxpnhostsrequest *ProjectsListXpnHostsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetUsageExportBucket: Enables the usage export feature and sets the usage -// export bucket where reports are stored. If you provide an empty request body -// using this method, the usage export feature will be disabled. +// ListXpnHosts: Lists all shared VPC host projects visible to the user in an +// organization. // // - project: Project ID for this request. -func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall { - c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) ListXpnHosts(project string, projectslistxpnhostsrequest *ProjectsListXpnHostsRequest) *ProjectsListXpnHostsCall { + c := &ProjectsListXpnHostsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.usageexportlocation = usageexportlocation + c.projectslistxpnhostsrequest = projectslistxpnhostsrequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *ProjectsListXpnHostsCall) Filter(filter string) *ProjectsListXpnHostsCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *ProjectsListXpnHostsCall) MaxResults(maxResults int64) *ProjectsListXpnHostsCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *ProjectsListXpnHostsCall) OrderBy(orderBy string) *ProjectsListXpnHostsCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *ProjectsListXpnHostsCall) PageToken(pageToken string) *ProjectsListXpnHostsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *ProjectsListXpnHostsCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsListXpnHostsCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall { +func (c *ProjectsListXpnHostsCall) Fields(s ...googleapi.Field) *ProjectsListXpnHostsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall { +func (c *ProjectsListXpnHostsCall) Context(ctx context.Context) *ProjectsListXpnHostsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *ProjectsSetUsageExportBucketCall) Header() http.Header { +func (c *ProjectsListXpnHostsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsListXpnHostsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectslistxpnhostsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setUsageExportBucket") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/listXpnHosts") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -55467,12 +55611,12 @@ func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.projects.setUsageExportBucket" call. +// Do executes the "compute.projects.listXpnHosts" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *XpnHostList.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsListXpnHostsCall) Do(opts ...googleapi.CallOption) (*XpnHostList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55491,7 +55635,7 @@ func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Op if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &XpnHostList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -55504,24 +55648,43 @@ func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Op return ret, nil } -type PublicAdvertisedPrefixesAnnounceCall struct { - s *Service - project string - publicAdvertisedPrefix string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *ProjectsListXpnHostsCall) Pages(ctx context.Context, f func(*XpnHostList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Announce: Announces the specified PublicAdvertisedPrefix +type ProjectsMoveDiskCall struct { + s *Service + project string + diskmoverequest *DiskMoveRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// MoveDisk: Moves a persistent disk from one zone to another. // -// - project: Project ID for this request. -// - publicAdvertisedPrefix: The name of the public advertised prefix. It -// should comply with RFC1035. -func (r *PublicAdvertisedPrefixesService) Announce(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesAnnounceCall { - c := &PublicAdvertisedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall { + c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.publicAdvertisedPrefix = publicAdvertisedPrefix + c.diskmoverequest = diskmoverequest return c } @@ -55535,7 +55698,7 @@ func (r *PublicAdvertisedPrefixesService) Announce(project string, publicAdverti // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicAdvertisedPrefixesAnnounceCall) RequestId(requestId string) *PublicAdvertisedPrefixesAnnounceCall { +func (c *ProjectsMoveDiskCall) RequestId(requestId string) *ProjectsMoveDiskCall { c.urlParams_.Set("requestId", requestId) return c } @@ -55543,32 +55706,36 @@ func (c *PublicAdvertisedPrefixesAnnounceCall) RequestId(requestId string) *Publ // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesAnnounceCall { +func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesAnnounceCall) Context(ctx context.Context) *PublicAdvertisedPrefixesAnnounceCall { +func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header { +func (c *ProjectsMoveDiskCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/moveDisk") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -55576,18 +55743,17 @@ func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Resp } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.announce" call. +// Do executes the "compute.projects.moveDisk" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicAdvertisedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsMoveDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55619,24 +55785,28 @@ func (c *PublicAdvertisedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) return ret, nil } -type PublicAdvertisedPrefixesDeleteCall struct { - s *Service - project string - publicAdvertisedPrefix string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsMoveInstanceCall struct { + s *Service + project string + instancemoverequest *InstanceMoveRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified PublicAdvertisedPrefix +// MoveInstance: Moves an instance and its attached persistent disks from one +// zone to another. *Note*: Moving VMs or disks by using this method might +// cause unexpected behavior. For more information, see the known issue +// (/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_mov +// einstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method +// is deprecated. See moving instance across zones +// (/compute/docs/instances/moving-instance-across-zones) instead. // -// - project: Project ID for this request. -// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource to -// delete. -func (r *PublicAdvertisedPrefixesService) Delete(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesDeleteCall { - c := &PublicAdvertisedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall { + c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.publicAdvertisedPrefix = publicAdvertisedPrefix + c.instancemoverequest = instancemoverequest return c } @@ -55650,7 +55820,7 @@ func (r *PublicAdvertisedPrefixesService) Delete(project string, publicAdvertise // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicAdvertisedPrefixesDeleteCall) RequestId(requestId string) *PublicAdvertisedPrefixesDeleteCall { +func (c *ProjectsMoveInstanceCall) RequestId(requestId string) *ProjectsMoveInstanceCall { c.urlParams_.Set("requestId", requestId) return c } @@ -55658,51 +55828,54 @@ func (c *PublicAdvertisedPrefixesDeleteCall) RequestId(requestId string) *Public // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesDeleteCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesDeleteCall { +func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesDeleteCall) Context(ctx context.Context) *PublicAdvertisedPrefixesDeleteCall { +func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesDeleteCall) Header() http.Header { +func (c *ProjectsMoveInstanceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } - -func (c *PublicAdvertisedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + +func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/moveInstance") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.delete" call. +// Do executes the "compute.projects.moveInstance" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicAdvertisedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsMoveInstanceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55734,88 +55907,94 @@ func (c *PublicAdvertisedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type PublicAdvertisedPrefixesGetCall struct { - s *Service - project string - publicAdvertisedPrefix string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsSetCloudArmorTierCall struct { + s *Service + project string + projectssetcloudarmortierrequest *ProjectsSetCloudArmorTierRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified PublicAdvertisedPrefix resource. +// SetCloudArmorTier: Sets the Cloud Armor tier of the project. To set +// ENTERPRISE or above the billing account of the project must be subscribed to +// Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more +// information. // -// - project: Project ID for this request. -// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource to -// return. -func (r *PublicAdvertisedPrefixesService) Get(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesGetCall { - c := &PublicAdvertisedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *ProjectsService) SetCloudArmorTier(project string, projectssetcloudarmortierrequest *ProjectsSetCloudArmorTierRequest) *ProjectsSetCloudArmorTierCall { + c := &ProjectsSetCloudArmorTierCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.publicAdvertisedPrefix = publicAdvertisedPrefix + c.projectssetcloudarmortierrequest = projectssetcloudarmortierrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *ProjectsSetCloudArmorTierCall) RequestId(requestId string) *ProjectsSetCloudArmorTierCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesGetCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesGetCall { +func (c *ProjectsSetCloudArmorTierCall) Fields(s ...googleapi.Field) *ProjectsSetCloudArmorTierCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *PublicAdvertisedPrefixesGetCall) IfNoneMatch(entityTag string) *PublicAdvertisedPrefixesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesGetCall) Context(ctx context.Context) *PublicAdvertisedPrefixesGetCall { +func (c *ProjectsSetCloudArmorTierCall) Context(ctx context.Context) *ProjectsSetCloudArmorTierCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesGetCall) Header() http.Header { +func (c *ProjectsSetCloudArmorTierCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicAdvertisedPrefixesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsSetCloudArmorTierCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetcloudarmortierrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setCloudArmorTier") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.get" call. +// Do executes the "compute.projects.setCloudArmorTier" call. // Any non-2xx status code is an error. Response headers are in either -// *PublicAdvertisedPrefix.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *PublicAdvertisedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicAdvertisedPrefix, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsSetCloudArmorTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55834,7 +56013,7 @@ func (c *PublicAdvertisedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*Pub if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PublicAdvertisedPrefix{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -55847,23 +56026,23 @@ func (c *PublicAdvertisedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*Pub return ret, nil } -type PublicAdvertisedPrefixesInsertCall struct { - s *Service - project string - publicadvertisedprefix *PublicAdvertisedPrefix - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsSetCommonInstanceMetadataCall struct { + s *Service + project string + metadata *Metadata + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a PublicAdvertisedPrefix in the specified project using the -// parameters that are included in the request. +// SetCommonInstanceMetadata: Sets metadata common to all instances within the +// specified project using the data included in the request. // // - project: Project ID for this request. -func (r *PublicAdvertisedPrefixesService) Insert(project string, publicadvertisedprefix *PublicAdvertisedPrefix) *PublicAdvertisedPrefixesInsertCall { - c := &PublicAdvertisedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.publicadvertisedprefix = publicadvertisedprefix + c.metadata = metadata return c } @@ -55877,7 +56056,7 @@ func (r *PublicAdvertisedPrefixesService) Insert(project string, publicadvertise // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicAdvertisedPrefixesInsertCall) RequestId(requestId string) *PublicAdvertisedPrefixesInsertCall { +func (c *ProjectsSetCommonInstanceMetadataCall) RequestId(requestId string) *ProjectsSetCommonInstanceMetadataCall { c.urlParams_.Set("requestId", requestId) return c } @@ -55885,36 +56064,36 @@ func (c *PublicAdvertisedPrefixesInsertCall) RequestId(requestId string) *Public // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesInsertCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesInsertCall { +func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesInsertCall) Context(ctx context.Context) *PublicAdvertisedPrefixesInsertCall { +func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesInsertCall) Header() http.Header { +func (c *ProjectsSetCommonInstanceMetadataCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setCommonInstanceMetadata") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -55927,12 +56106,12 @@ func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.insert" call. +// Do executes the "compute.projects.setCommonInstanceMetadata" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicAdvertisedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsSetCommonInstanceMetadataCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -55964,144 +56143,77 @@ func (c *PublicAdvertisedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type PublicAdvertisedPrefixesListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type ProjectsSetDefaultNetworkTierCall struct { + s *Service + project string + projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists the PublicAdvertisedPrefixes for a project. +// SetDefaultNetworkTier: Sets the default network tier of the project. The +// default network tier is used when an address/forwardingRule/instance is +// created without specifying the network tier field. // // - project: Project ID for this request. -func (r *PublicAdvertisedPrefixesService) List(project string) *PublicAdvertisedPrefixesListCall { - c := &PublicAdvertisedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *ProjectsService) SetDefaultNetworkTier(project string, projectssetdefaultnetworktierrequest *ProjectsSetDefaultNetworkTierRequest) *ProjectsSetDefaultNetworkTierCall { + c := &ProjectsSetDefaultNetworkTierCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.projectssetdefaultnetworktierrequest = projectssetdefaultnetworktierrequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *PublicAdvertisedPrefixesListCall) Filter(filter string) *PublicAdvertisedPrefixesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *PublicAdvertisedPrefixesListCall) MaxResults(maxResults int64) *PublicAdvertisedPrefixesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *PublicAdvertisedPrefixesListCall) OrderBy(orderBy string) *PublicAdvertisedPrefixesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *PublicAdvertisedPrefixesListCall) PageToken(pageToken string) *PublicAdvertisedPrefixesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *PublicAdvertisedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicAdvertisedPrefixesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *ProjectsSetDefaultNetworkTierCall) RequestId(requestId string) *ProjectsSetDefaultNetworkTierCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesListCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesListCall { +func (c *ProjectsSetDefaultNetworkTierCall) Fields(s ...googleapi.Field) *ProjectsSetDefaultNetworkTierCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *PublicAdvertisedPrefixesListCall) IfNoneMatch(entityTag string) *PublicAdvertisedPrefixesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesListCall) Context(ctx context.Context) *PublicAdvertisedPrefixesListCall { +func (c *ProjectsSetDefaultNetworkTierCall) Context(ctx context.Context) *ProjectsSetDefaultNetworkTierCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesListCall) Header() http.Header { +func (c *ProjectsSetDefaultNetworkTierCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *ProjectsSetDefaultNetworkTierCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectssetdefaultnetworktierrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setDefaultNetworkTier") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -56112,13 +56224,12 @@ func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.list" call. +// Do executes the "compute.projects.setDefaultNetworkTier" call. // Any non-2xx status code is an error. Response headers are in either -// *PublicAdvertisedPrefixList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *PublicAdvertisedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicAdvertisedPrefixList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *ProjectsSetDefaultNetworkTierCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56137,7 +56248,7 @@ func (c *PublicAdvertisedPrefixesListCall) Do(opts ...googleapi.CallOption) (*Pu if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PublicAdvertisedPrefixList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -56150,49 +56261,24 @@ func (c *PublicAdvertisedPrefixesListCall) Do(opts ...googleapi.CallOption) (*Pu return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *PublicAdvertisedPrefixesListCall) Pages(ctx context.Context, f func(*PublicAdvertisedPrefixList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type PublicAdvertisedPrefixesPatchCall struct { - s *Service - project string - publicAdvertisedPrefix string - publicadvertisedprefix *PublicAdvertisedPrefix - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type ProjectsSetUsageExportBucketCall struct { + s *Service + project string + usageexportlocation *UsageExportLocation + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Patches the specified Router resource with the data included in the -// request. This method supports PATCH semantics and uses JSON merge patch -// format and processing rules. +// SetUsageExportBucket: Enables the usage export feature and sets the usage +// export bucket where reports are stored. If you provide an empty request body +// using this method, the usage export feature will be disabled. // -// - project: Project ID for this request. -// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource to -// patch. -func (r *PublicAdvertisedPrefixesService) Patch(project string, publicAdvertisedPrefix string, publicadvertisedprefix *PublicAdvertisedPrefix) *PublicAdvertisedPrefixesPatchCall { - c := &PublicAdvertisedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall { + c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.publicAdvertisedPrefix = publicAdvertisedPrefix - c.publicadvertisedprefix = publicadvertisedprefix + c.usageexportlocation = usageexportlocation return c } @@ -56206,7 +56292,7 @@ func (r *PublicAdvertisedPrefixesService) Patch(project string, publicAdvertised // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicAdvertisedPrefixesPatchCall) RequestId(requestId string) *PublicAdvertisedPrefixesPatchCall { +func (c *ProjectsSetUsageExportBucketCall) RequestId(requestId string) *ProjectsSetUsageExportBucketCall { c.urlParams_.Set("requestId", requestId) return c } @@ -56214,55 +56300,54 @@ func (c *PublicAdvertisedPrefixesPatchCall) RequestId(requestId string) *PublicA // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesPatchCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesPatchCall { +func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesPatchCall) Context(ctx context.Context) *PublicAdvertisedPrefixesPatchCall { +func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesPatchCall) Header() http.Header { +func (c *ProjectsSetUsageExportBucketCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicAdvertisedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/setUsageExportBucket") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.patch" call. +// Do executes the "compute.projects.setUsageExportBucket" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicAdvertisedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *ProjectsSetUsageExportBucketCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56294,7 +56379,7 @@ func (c *PublicAdvertisedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type PublicAdvertisedPrefixesWithdrawCall struct { +type PublicAdvertisedPrefixesAnnounceCall struct { s *Service project string publicAdvertisedPrefix string @@ -56303,13 +56388,13 @@ type PublicAdvertisedPrefixesWithdrawCall struct { header_ http.Header } -// Withdraw: Withdraws the specified PublicAdvertisedPrefix +// Announce: Announces the specified PublicAdvertisedPrefix // // - project: Project ID for this request. // - publicAdvertisedPrefix: The name of the public advertised prefix. It // should comply with RFC1035. -func (r *PublicAdvertisedPrefixesService) Withdraw(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesWithdrawCall { - c := &PublicAdvertisedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *PublicAdvertisedPrefixesService) Announce(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesAnnounceCall { + c := &PublicAdvertisedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.publicAdvertisedPrefix = publicAdvertisedPrefix return c @@ -56325,7 +56410,7 @@ func (r *PublicAdvertisedPrefixesService) Withdraw(project string, publicAdverti // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicAdvertisedPrefixesWithdrawCall) RequestId(requestId string) *PublicAdvertisedPrefixesWithdrawCall { +func (c *PublicAdvertisedPrefixesAnnounceCall) RequestId(requestId string) *PublicAdvertisedPrefixesAnnounceCall { c.urlParams_.Set("requestId", requestId) return c } @@ -56333,32 +56418,32 @@ func (c *PublicAdvertisedPrefixesWithdrawCall) RequestId(requestId string) *Publ // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicAdvertisedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesWithdrawCall { +func (c *PublicAdvertisedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesAnnounceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicAdvertisedPrefixesWithdrawCall) Context(ctx context.Context) *PublicAdvertisedPrefixesWithdrawCall { +func (c *PublicAdvertisedPrefixesAnnounceCall) Context(ctx context.Context) *PublicAdvertisedPrefixesAnnounceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header { +func (c *PublicAdvertisedPrefixesAnnounceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicAdvertisedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/announce") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -56372,12 +56457,12 @@ func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicAdvertisedPrefixes.withdraw" call. +// Do executes the "compute.publicAdvertisedPrefixes.announce" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicAdvertisedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicAdvertisedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56409,129 +56494,147 @@ func (c *PublicAdvertisedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) return ret, nil } -type PublicDelegatedPrefixesAggregatedListCall struct { - s *Service - project string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type PublicAdvertisedPrefixesDeleteCall struct { + s *Service + project string + publicAdvertisedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// AggregatedList: Lists all PublicDelegatedPrefix resources owned by the -// specific project across all scopes. To prevent failure, Google recommends -// that you set the `returnPartialSuccess` parameter to `true`. +// Delete: Deletes the specified PublicAdvertisedPrefix // -// - project: Name of the project scoping this request. -func (r *PublicDelegatedPrefixesService) AggregatedList(project string) *PublicDelegatedPrefixesAggregatedListCall { - c := &PublicDelegatedPrefixesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource to +// delete. +func (r *PublicAdvertisedPrefixesService) Delete(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesDeleteCall { + c := &PublicAdvertisedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.publicAdvertisedPrefix = publicAdvertisedPrefix return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *PublicDelegatedPrefixesAggregatedListCall) Filter(filter string) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("filter", filter) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PublicAdvertisedPrefixesDeleteCall) RequestId(requestId string) *PublicAdvertisedPrefixesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *PublicDelegatedPrefixesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *PublicAdvertisedPrefixesDeleteCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *PublicDelegatedPrefixesAggregatedListCall) MaxResults(maxResults int64) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// Context sets the context to be used in this call's Do method. +func (c *PublicAdvertisedPrefixesDeleteCall) Context(ctx context.Context) *PublicAdvertisedPrefixesDeleteCall { + c.ctx_ = ctx return c } -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *PublicDelegatedPrefixesAggregatedListCall) OrderBy(orderBy string) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("orderBy", orderBy) - return c +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *PublicAdvertisedPrefixesDeleteCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ } -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *PublicDelegatedPrefixesAggregatedListCall) PageToken(pageToken string) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("pageToken", pageToken) - return c +func (c *PublicAdvertisedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("DELETE", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "publicAdvertisedPrefix": c.publicAdvertisedPrefix, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *PublicDelegatedPrefixesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c +// Do executes the "compute.publicAdvertisedPrefixes.delete" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *PublicAdvertisedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *PublicDelegatedPrefixesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *PublicDelegatedPrefixesAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) +type PublicAdvertisedPrefixesGetCall struct { + s *Service + project string + publicAdvertisedPrefix string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns the specified PublicAdvertisedPrefix resource. +// +// - project: Project ID for this request. +// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource to +// return. +func (r *PublicAdvertisedPrefixesService) Get(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesGetCall { + c := &PublicAdvertisedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.publicAdvertisedPrefix = publicAdvertisedPrefix return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesAggregatedListCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAggregatedListCall { +func (c *PublicAdvertisedPrefixesGetCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -56539,27 +56642,27 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) Fields(s ...googleapi.Field) // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *PublicDelegatedPrefixesAggregatedListCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesAggregatedListCall { +func (c *PublicAdvertisedPrefixesGetCall) IfNoneMatch(entityTag string) *PublicAdvertisedPrefixesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesAggregatedListCall) Context(ctx context.Context) *PublicDelegatedPrefixesAggregatedListCall { +func (c *PublicAdvertisedPrefixesGetCall) Context(ctx context.Context) *PublicAdvertisedPrefixesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesAggregatedListCall) Header() http.Header { +func (c *PublicAdvertisedPrefixesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicAdvertisedPrefixesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -56567,7 +56670,7 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/publicDelegatedPrefixes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -56575,18 +56678,19 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "publicAdvertisedPrefix": c.publicAdvertisedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.aggregatedList" call. +// Do executes the "compute.publicAdvertisedPrefixes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *PublicDelegatedPrefixAggregatedList.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesAggregatedListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixAggregatedList, error) { +// *PublicAdvertisedPrefix.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *PublicAdvertisedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicAdvertisedPrefix, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56605,7 +56709,7 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PublicDelegatedPrefixAggregatedList{ + ret := &PublicAdvertisedPrefix{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -56618,49 +56722,23 @@ func (c *PublicDelegatedPrefixesAggregatedListCall) Do(opts ...googleapi.CallOpt return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *PublicDelegatedPrefixesAggregatedListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixAggregatedList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type PublicDelegatedPrefixesAnnounceCall struct { - s *Service - project string - region string - publicDelegatedPrefix string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicAdvertisedPrefixesInsertCall struct { + s *Service + project string + publicadvertisedprefix *PublicAdvertisedPrefix + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Announce: Announces the specified PublicDelegatedPrefix in the given region. +// Insert: Creates a PublicAdvertisedPrefix in the specified project using the +// parameters that are included in the request. // -// - project: Project ID for this request. -// - publicDelegatedPrefix: The name of the public delegated prefix. It should -// comply with RFC1035. -// - region: The name of the region where the public delegated prefix is -// located. It should comply with RFC1035. -func (r *PublicDelegatedPrefixesService) Announce(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesAnnounceCall { - c := &PublicDelegatedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +func (r *PublicAdvertisedPrefixesService) Insert(project string, publicadvertisedprefix *PublicAdvertisedPrefix) *PublicAdvertisedPrefixesInsertCall { + c := &PublicAdvertisedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.publicDelegatedPrefix = publicDelegatedPrefix + c.publicadvertisedprefix = publicadvertisedprefix return c } @@ -56674,7 +56752,7 @@ func (r *PublicDelegatedPrefixesService) Announce(project string, region string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicDelegatedPrefixesAnnounceCall) RequestId(requestId string) *PublicDelegatedPrefixesAnnounceCall { +func (c *PublicAdvertisedPrefixesInsertCall) RequestId(requestId string) *PublicAdvertisedPrefixesInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -56682,32 +56760,36 @@ func (c *PublicDelegatedPrefixesAnnounceCall) RequestId(requestId string) *Publi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAnnounceCall { +func (c *PublicAdvertisedPrefixesInsertCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesAnnounceCall) Context(ctx context.Context) *PublicDelegatedPrefixesAnnounceCall { +func (c *PublicAdvertisedPrefixesInsertCall) Context(ctx context.Context) *PublicAdvertisedPrefixesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesAnnounceCall) Header() http.Header { +func (c *PublicAdvertisedPrefixesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *PublicAdvertisedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -56715,19 +56797,17 @@ func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Respo } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "publicDelegatedPrefix": c.publicDelegatedPrefix, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.announce" call. +// Do executes the "compute.publicAdvertisedPrefixes.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicAdvertisedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56759,94 +56839,161 @@ func (c *PublicDelegatedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type PublicDelegatedPrefixesDeleteCall struct { - s *Service - project string - region string - publicDelegatedPrefix string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicAdvertisedPrefixesListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Lists the PublicAdvertisedPrefixes for a project. +// +// - project: Project ID for this request. +func (r *PublicAdvertisedPrefixesService) List(project string) *PublicAdvertisedPrefixesListCall { + c := &PublicAdvertisedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *PublicAdvertisedPrefixesListCall) Filter(filter string) *PublicAdvertisedPrefixesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *PublicAdvertisedPrefixesListCall) MaxResults(maxResults int64) *PublicAdvertisedPrefixesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c } -// Delete: Deletes the specified PublicDelegatedPrefix in the given region. -// -// - project: Project ID for this request. -// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to -// delete. -// - region: Name of the region of this request. -func (r *PublicDelegatedPrefixesService) Delete(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesDeleteCall { - c := &PublicDelegatedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.publicDelegatedPrefix = publicDelegatedPrefix +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *PublicAdvertisedPrefixesListCall) OrderBy(orderBy string) *PublicAdvertisedPrefixesListCall { + c.urlParams_.Set("orderBy", orderBy) return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicDelegatedPrefixesDeleteCall) RequestId(requestId string) *PublicDelegatedPrefixesDeleteCall { - c.urlParams_.Set("requestId", requestId) +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *PublicAdvertisedPrefixesListCall) PageToken(pageToken string) *PublicAdvertisedPrefixesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *PublicAdvertisedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicAdvertisedPrefixesListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesDeleteCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesDeleteCall { +func (c *PublicAdvertisedPrefixesListCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *PublicAdvertisedPrefixesListCall) IfNoneMatch(entityTag string) *PublicAdvertisedPrefixesListCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesDeleteCall) Context(ctx context.Context) *PublicDelegatedPrefixesDeleteCall { +func (c *PublicAdvertisedPrefixesListCall) Context(ctx context.Context) *PublicAdvertisedPrefixesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesDeleteCall) Header() http.Header { +func (c *PublicAdvertisedPrefixesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicAdvertisedPrefixesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "publicDelegatedPrefix": c.publicDelegatedPrefix, + "project": c.project, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.delete" call. +// Do executes the "compute.publicAdvertisedPrefixes.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *PublicAdvertisedPrefixList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PublicAdvertisedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicAdvertisedPrefixList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56865,7 +57012,7 @@ func (c *PublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*O if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &PublicAdvertisedPrefixList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -56878,93 +57025,119 @@ func (c *PublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type PublicDelegatedPrefixesGetCall struct { - s *Service - project string - region string - publicDelegatedPrefix string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *PublicAdvertisedPrefixesListCall) Pages(ctx context.Context, f func(*PublicAdvertisedPrefixList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Get: Returns the specified PublicDelegatedPrefix resource in the given -// region. +type PublicAdvertisedPrefixesPatchCall struct { + s *Service + project string + publicAdvertisedPrefix string + publicadvertisedprefix *PublicAdvertisedPrefix + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Patches the specified Router resource with the data included in the +// request. This method supports PATCH semantics and uses JSON merge patch +// format and processing rules. // // - project: Project ID for this request. -// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to -// return. -// - region: Name of the region of this request. -func (r *PublicDelegatedPrefixesService) Get(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesGetCall { - c := &PublicDelegatedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - publicAdvertisedPrefix: Name of the PublicAdvertisedPrefix resource to +// patch. +func (r *PublicAdvertisedPrefixesService) Patch(project string, publicAdvertisedPrefix string, publicadvertisedprefix *PublicAdvertisedPrefix) *PublicAdvertisedPrefixesPatchCall { + c := &PublicAdvertisedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.publicDelegatedPrefix = publicDelegatedPrefix + c.publicAdvertisedPrefix = publicAdvertisedPrefix + c.publicadvertisedprefix = publicadvertisedprefix + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *PublicAdvertisedPrefixesPatchCall) RequestId(requestId string) *PublicAdvertisedPrefixesPatchCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesGetCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesGetCall { +func (c *PublicAdvertisedPrefixesPatchCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *PublicDelegatedPrefixesGetCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesGetCall) Context(ctx context.Context) *PublicDelegatedPrefixesGetCall { +func (c *PublicAdvertisedPrefixesPatchCall) Context(ctx context.Context) *PublicAdvertisedPrefixesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesGetCall) Header() http.Header { +func (c *PublicAdvertisedPrefixesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *PublicAdvertisedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicadvertisedprefix) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "publicDelegatedPrefix": c.publicDelegatedPrefix, + "project": c.project, + "publicAdvertisedPrefix": c.publicAdvertisedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.get" call. +// Do executes the "compute.publicAdvertisedPrefixes.patch" call. // Any non-2xx status code is an error. Response headers are in either -// *PublicDelegatedPrefix.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *PublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefix, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *PublicAdvertisedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -56983,7 +57156,7 @@ func (c *PublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*Publ if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PublicDelegatedPrefix{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -56996,26 +57169,24 @@ func (c *PublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*Publ return ret, nil } -type PublicDelegatedPrefixesInsertCall struct { - s *Service - project string - region string - publicdelegatedprefix *PublicDelegatedPrefix - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicAdvertisedPrefixesWithdrawCall struct { + s *Service + project string + publicAdvertisedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a PublicDelegatedPrefix in the specified project in the -// given region using the parameters that are included in the request. +// Withdraw: Withdraws the specified PublicAdvertisedPrefix // -// - project: Project ID for this request. -// - region: Name of the region of this request. -func (r *PublicDelegatedPrefixesService) Insert(project string, region string, publicdelegatedprefix *PublicDelegatedPrefix) *PublicDelegatedPrefixesInsertCall { - c := &PublicDelegatedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - publicAdvertisedPrefix: The name of the public advertised prefix. It +// should comply with RFC1035. +func (r *PublicAdvertisedPrefixesService) Withdraw(project string, publicAdvertisedPrefix string) *PublicAdvertisedPrefixesWithdrawCall { + c := &PublicAdvertisedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region - c.publicdelegatedprefix = publicdelegatedprefix + c.publicAdvertisedPrefix = publicAdvertisedPrefix return c } @@ -57029,7 +57200,7 @@ func (r *PublicDelegatedPrefixesService) Insert(project string, region string, p // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicDelegatedPrefixesInsertCall) RequestId(requestId string) *PublicDelegatedPrefixesInsertCall { +func (c *PublicAdvertisedPrefixesWithdrawCall) RequestId(requestId string) *PublicAdvertisedPrefixesWithdrawCall { c.urlParams_.Set("requestId", requestId) return c } @@ -57037,36 +57208,32 @@ func (c *PublicDelegatedPrefixesInsertCall) RequestId(requestId string) *PublicD // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesInsertCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesInsertCall { +func (c *PublicAdvertisedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicAdvertisedPrefixesWithdrawCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesInsertCall) Context(ctx context.Context) *PublicDelegatedPrefixesInsertCall { +func (c *PublicAdvertisedPrefixesWithdrawCall) Context(ctx context.Context) *PublicAdvertisedPrefixesWithdrawCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesInsertCall) Header() http.Header { +func (c *PublicAdvertisedPrefixesWithdrawCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *PublicAdvertisedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/global/publicAdvertisedPrefixes/{publicAdvertisedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -57074,18 +57241,18 @@ func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Respons } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "publicAdvertisedPrefix": c.publicAdvertisedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.insert" call. +// Do executes the "compute.publicAdvertisedPrefixes.withdraw" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicAdvertisedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -57117,24 +57284,23 @@ func (c *PublicDelegatedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*O return ret, nil } -type PublicDelegatedPrefixesListCall struct { +type PublicDelegatedPrefixesAggregatedListCall struct { s *Service project string - region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Lists the PublicDelegatedPrefixes for a project in the given region. +// AggregatedList: Lists all PublicDelegatedPrefix resources owned by the +// specific project across all scopes. To prevent failure, Google recommends +// that you set the `returnPartialSuccess` parameter to `true`. // -// - project: Project ID for this request. -// - region: Name of the region of this request. -func (r *PublicDelegatedPrefixesService) List(project string, region string) *PublicDelegatedPrefixesListCall { - c := &PublicDelegatedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Name of the project scoping this request. +func (r *PublicDelegatedPrefixesService) AggregatedList(project string) *PublicDelegatedPrefixesAggregatedListCall { + c := &PublicDelegatedPrefixesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region return c } @@ -57170,17 +57336,30 @@ func (r *PublicDelegatedPrefixesService) List(project string, region string) *Pu // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *PublicDelegatedPrefixesListCall) Filter(filter string) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) Filter(filter string) *PublicDelegatedPrefixesAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *PublicDelegatedPrefixesAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *PublicDelegatedPrefixesAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *PublicDelegatedPrefixesListCall) MaxResults(maxResults int64) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) MaxResults(maxResults int64) *PublicDelegatedPrefixesAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -57193,7 +57372,7 @@ func (c *PublicDelegatedPrefixesListCall) MaxResults(maxResults int64) *PublicDe // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *PublicDelegatedPrefixesListCall) OrderBy(orderBy string) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) OrderBy(orderBy string) *PublicDelegatedPrefixesAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -57201,7 +57380,7 @@ func (c *PublicDelegatedPrefixesListCall) OrderBy(orderBy string) *PublicDelegat // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *PublicDelegatedPrefixesListCall) PageToken(pageToken string) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) PageToken(pageToken string) *PublicDelegatedPrefixesAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -57211,15 +57390,23 @@ func (c *PublicDelegatedPrefixesListCall) PageToken(pageToken string) *PublicDel // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *PublicDelegatedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicDelegatedPrefixesAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *PublicDelegatedPrefixesAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *PublicDelegatedPrefixesAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesListCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -57227,27 +57414,27 @@ func (c *PublicDelegatedPrefixesListCall) Fields(s ...googleapi.Field) *PublicDe // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *PublicDelegatedPrefixesListCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesListCall) Context(ctx context.Context) *PublicDelegatedPrefixesListCall { +func (c *PublicDelegatedPrefixesAggregatedListCall) Context(ctx context.Context) *PublicDelegatedPrefixesAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesListCall) Header() http.Header { +func (c *PublicDelegatedPrefixesAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -57255,7 +57442,7 @@ func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -57264,18 +57451,17 @@ func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.list" call. +// Do executes the "compute.publicDelegatedPrefixes.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *PublicDelegatedPrefixList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use +// *PublicDelegatedPrefixAggregatedList.ServerResponse.Header or (if a response +// was returned at all) in error.(*googleapi.Error).Header. Use // googleapi.IsNotModified to check whether the returned error was because // http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixList, error) { +func (c *PublicDelegatedPrefixesAggregatedListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -57294,7 +57480,7 @@ func (c *PublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*Pub if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &PublicDelegatedPrefixList{ + ret := &PublicDelegatedPrefixAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -57310,7 +57496,7 @@ func (c *PublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*Pub // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *PublicDelegatedPrefixesListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixList) error) error { +func (c *PublicDelegatedPrefixesAggregatedListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -57328,134 +57514,7 @@ func (c *PublicDelegatedPrefixesListCall) Pages(ctx context.Context, f func(*Pub } } -type PublicDelegatedPrefixesPatchCall struct { - s *Service - project string - region string - publicDelegatedPrefix string - publicdelegatedprefix *PublicDelegatedPrefix - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Patch: Patches the specified PublicDelegatedPrefix resource with the data -// included in the request. This method supports PATCH semantics and uses JSON -// merge patch format and processing rules. -// -// - project: Project ID for this request. -// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to -// patch. -// - region: Name of the region for this request. -func (r *PublicDelegatedPrefixesService) Patch(project string, region string, publicDelegatedPrefix string, publicdelegatedprefix *PublicDelegatedPrefix) *PublicDelegatedPrefixesPatchCall { - c := &PublicDelegatedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.publicDelegatedPrefix = publicDelegatedPrefix - c.publicdelegatedprefix = publicdelegatedprefix - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicDelegatedPrefixesPatchCall) RequestId(requestId string) *PublicDelegatedPrefixesPatchCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *PublicDelegatedPrefixesPatchCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesPatchCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesPatchCall) Context(ctx context.Context) *PublicDelegatedPrefixesPatchCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *PublicDelegatedPrefixesPatchCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *PublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "publicDelegatedPrefix": c.publicDelegatedPrefix, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.publicDelegatedPrefixes.patch" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type PublicDelegatedPrefixesWithdrawCall struct { +type PublicDelegatedPrefixesAnnounceCall struct { s *Service project string region string @@ -57465,15 +57524,15 @@ type PublicDelegatedPrefixesWithdrawCall struct { header_ http.Header } -// Withdraw: Withdraws the specified PublicDelegatedPrefix in the given region. +// Announce: Announces the specified PublicDelegatedPrefix in the given region. // // - project: Project ID for this request. // - publicDelegatedPrefix: The name of the public delegated prefix. It should // comply with RFC1035. // - region: The name of the region where the public delegated prefix is // located. It should comply with RFC1035. -func (r *PublicDelegatedPrefixesService) Withdraw(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesWithdrawCall { - c := &PublicDelegatedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *PublicDelegatedPrefixesService) Announce(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesAnnounceCall { + c := &PublicDelegatedPrefixesAnnounceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.publicDelegatedPrefix = publicDelegatedPrefix @@ -57490,7 +57549,7 @@ func (r *PublicDelegatedPrefixesService) Withdraw(project string, region string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *PublicDelegatedPrefixesWithdrawCall) RequestId(requestId string) *PublicDelegatedPrefixesWithdrawCall { +func (c *PublicDelegatedPrefixesAnnounceCall) RequestId(requestId string) *PublicDelegatedPrefixesAnnounceCall { c.urlParams_.Set("requestId", requestId) return c } @@ -57498,32 +57557,32 @@ func (c *PublicDelegatedPrefixesWithdrawCall) RequestId(requestId string) *Publi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *PublicDelegatedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesWithdrawCall { +func (c *PublicDelegatedPrefixesAnnounceCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesAnnounceCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *PublicDelegatedPrefixesWithdrawCall) Context(ctx context.Context) *PublicDelegatedPrefixesWithdrawCall { +func (c *PublicDelegatedPrefixesAnnounceCall) Context(ctx context.Context) *PublicDelegatedPrefixesAnnounceCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *PublicDelegatedPrefixesWithdrawCall) Header() http.Header { +func (c *PublicDelegatedPrefixesAnnounceCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesAnnounceCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/announce") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -57538,12 +57597,12 @@ func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Respo return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.publicDelegatedPrefixes.withdraw" call. +// Do executes the "compute.publicDelegatedPrefixes.announce" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *PublicDelegatedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicDelegatedPrefixesAnnounceCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -57575,26 +57634,27 @@ func (c *PublicDelegatedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type RegionAutoscalersDeleteCall struct { - s *Service - project string - region string - autoscaler string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicDelegatedPrefixesDeleteCall struct { + s *Service + project string + region string + publicDelegatedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified autoscaler. +// Delete: Deletes the specified PublicDelegatedPrefix in the given region. // -// - autoscaler: Name of the autoscaler to delete. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall { - c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to +// delete. +// - region: Name of the region of this request. +func (r *PublicDelegatedPrefixesService) Delete(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesDeleteCall { + c := &PublicDelegatedPrefixesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler + c.publicDelegatedPrefix = publicDelegatedPrefix return c } @@ -57608,7 +57668,7 @@ func (r *RegionAutoscalersService) Delete(project string, region string, autosca // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall { +func (c *PublicDelegatedPrefixesDeleteCall) RequestId(requestId string) *PublicDelegatedPrefixesDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -57616,32 +57676,32 @@ func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutosca // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall { +func (c *PublicDelegatedPrefixesDeleteCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall { +func (c *PublicDelegatedPrefixesDeleteCall) Context(ctx context.Context) *PublicDelegatedPrefixesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersDeleteCall) Header() http.Header { +func (c *PublicDelegatedPrefixesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -57649,19 +57709,19 @@ func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "autoscaler": c.autoscaler, + "project": c.project, + "region": c.region, + "publicDelegatedPrefix": c.publicDelegatedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.delete" call. +// Do executes the "compute.publicDelegatedPrefixes.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicDelegatedPrefixesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -57693,34 +57753,36 @@ func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionAutoscalersGetCall struct { - s *Service - project string - region string - autoscaler string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type PublicDelegatedPrefixesGetCall struct { + s *Service + project string + region string + publicDelegatedPrefix string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified autoscaler. +// Get: Returns the specified PublicDelegatedPrefix resource in the given +// region. // -// - autoscaler: Name of the autoscaler to return. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall { - c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to +// return. +// - region: Name of the region of this request. +func (r *PublicDelegatedPrefixesService) Get(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesGetCall { + c := &PublicDelegatedPrefixesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler + c.publicDelegatedPrefix = publicDelegatedPrefix return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall { +func (c *PublicDelegatedPrefixesGetCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -57728,27 +57790,27 @@ func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscale // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall { +func (c *PublicDelegatedPrefixesGetCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall { +func (c *PublicDelegatedPrefixesGetCall) Context(ctx context.Context) *PublicDelegatedPrefixesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersGetCall) Header() http.Header { +func (c *PublicDelegatedPrefixesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -57756,7 +57818,7 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -57764,19 +57826,20 @@ func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "autoscaler": c.autoscaler, + "project": c.project, + "region": c.region, + "publicDelegatedPrefix": c.publicDelegatedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.get" call. +// Do executes the "compute.publicDelegatedPrefixes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Autoscaler.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) { +// *PublicDelegatedPrefix.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *PublicDelegatedPrefixesGetCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefix, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -57795,7 +57858,7 @@ func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Autoscaler{ + ret := &PublicDelegatedPrefix{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -57808,26 +57871,26 @@ func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler return ret, nil } -type RegionAutoscalersInsertCall struct { - s *Service - project string - region string - autoscaler *Autoscaler - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicDelegatedPrefixesInsertCall struct { + s *Service + project string + region string + publicdelegatedprefix *PublicDelegatedPrefix + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates an autoscaler in the specified project using the data -// included in the request. +// Insert: Creates a PublicDelegatedPrefix in the specified project in the +// given region using the parameters that are included in the request. // // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall { - c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region of this request. +func (r *PublicDelegatedPrefixesService) Insert(project string, region string, publicdelegatedprefix *PublicDelegatedPrefix) *PublicDelegatedPrefixesInsertCall { + c := &PublicDelegatedPrefixesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler + c.publicdelegatedprefix = publicdelegatedprefix return c } @@ -57841,7 +57904,7 @@ func (r *RegionAutoscalersService) Insert(project string, region string, autosca // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall { +func (c *PublicDelegatedPrefixesInsertCall) RequestId(requestId string) *PublicDelegatedPrefixesInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -57849,36 +57912,36 @@ func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutosca // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall { +func (c *PublicDelegatedPrefixesInsertCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall { +func (c *PublicDelegatedPrefixesInsertCall) Context(ctx context.Context) *PublicDelegatedPrefixesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersInsertCall) Header() http.Header { +func (c *PublicDelegatedPrefixesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -57892,12 +57955,12 @@ func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, err return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.insert" call. +// Do executes the "compute.publicDelegatedPrefixes.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicDelegatedPrefixesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -57929,7 +57992,7 @@ func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionAutoscalersListCall struct { +type PublicDelegatedPrefixesListCall struct { s *Service project string region string @@ -57939,12 +58002,12 @@ type RegionAutoscalersListCall struct { header_ http.Header } -// List: Retrieves a list of autoscalers contained within the specified region. +// List: Lists the PublicDelegatedPrefixes for a project in the given region. // // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall { - c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region of this request. +func (r *PublicDelegatedPrefixesService) List(project string, region string) *PublicDelegatedPrefixesListCall { + c := &PublicDelegatedPrefixesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c @@ -57982,7 +58045,7 @@ func (r *RegionAutoscalersService) List(project string, region string) *RegionAu // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) Filter(filter string) *PublicDelegatedPrefixesListCall { c.urlParams_.Set("filter", filter) return c } @@ -57992,7 +58055,7 @@ func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersList // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) MaxResults(maxResults int64) *PublicDelegatedPrefixesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -58005,7 +58068,7 @@ func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscal // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) OrderBy(orderBy string) *PublicDelegatedPrefixesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -58013,7 +58076,7 @@ func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersLi // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) PageToken(pageToken string) *PublicDelegatedPrefixesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -58023,7 +58086,7 @@ func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscale // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *RegionAutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *PublicDelegatedPrefixesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -58031,7 +58094,7 @@ func (c *RegionAutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bo // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -58039,27 +58102,27 @@ func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscal // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) IfNoneMatch(entityTag string) *PublicDelegatedPrefixesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall { +func (c *PublicDelegatedPrefixesListCall) Context(ctx context.Context) *PublicDelegatedPrefixesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersListCall) Header() http.Header { +func (c *PublicDelegatedPrefixesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -58067,7 +58130,7 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -58081,13 +58144,13 @@ func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.list" call. +// Do executes the "compute.publicDelegatedPrefixes.list" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionAutoscalerList.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) { +// *PublicDelegatedPrefixList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *PublicDelegatedPrefixesListCall) Do(opts ...googleapi.CallOption) (*PublicDelegatedPrefixList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -58106,7 +58169,7 @@ func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAut if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionAutoscalerList{ + ret := &PublicDelegatedPrefixList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -58122,7 +58185,7 @@ func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAut // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error { +func (c *PublicDelegatedPrefixesListCall) Pages(ctx context.Context, f func(*PublicDelegatedPrefixList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -58140,34 +58203,31 @@ func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAut } } -type RegionAutoscalersPatchCall struct { - s *Service - project string - region string - autoscaler *Autoscaler - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicDelegatedPrefixesPatchCall struct { + s *Service + project string + region string + publicDelegatedPrefix string + publicdelegatedprefix *PublicDelegatedPrefix + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates an autoscaler in the specified project using the data -// included in the request. This method supports PATCH semantics and uses the -// JSON merge patch format and processing rules. +// Patch: Patches the specified PublicDelegatedPrefix resource with the data +// included in the request. This method supports PATCH semantics and uses JSON +// merge patch format and processing rules. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall { - c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - publicDelegatedPrefix: Name of the PublicDelegatedPrefix resource to +// patch. +// - region: Name of the region for this request. +func (r *PublicDelegatedPrefixesService) Patch(project string, region string, publicDelegatedPrefix string, publicdelegatedprefix *PublicDelegatedPrefix) *PublicDelegatedPrefixesPatchCall { + c := &PublicDelegatedPrefixesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler - return c -} - -// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler -// to patch. -func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall { - c.urlParams_.Set("autoscaler", autoscaler) + c.publicDelegatedPrefix = publicDelegatedPrefix + c.publicdelegatedprefix = publicdelegatedprefix return c } @@ -58181,7 +58241,7 @@ func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutosc // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall { +func (c *PublicDelegatedPrefixesPatchCall) RequestId(requestId string) *PublicDelegatedPrefixesPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -58189,36 +58249,36 @@ func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscal // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall { +func (c *PublicDelegatedPrefixesPatchCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall { +func (c *PublicDelegatedPrefixesPatchCall) Context(ctx context.Context) *PublicDelegatedPrefixesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersPatchCall) Header() http.Header { +func (c *PublicDelegatedPrefixesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *PublicDelegatedPrefixesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.publicdelegatedprefix) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { @@ -58226,18 +58286,19 @@ func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, erro } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "publicDelegatedPrefix": c.publicDelegatedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.patch" call. +// Do executes the "compute.publicDelegatedPrefixes.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicDelegatedPrefixesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -58269,33 +58330,28 @@ func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operatio return ret, nil } -type RegionAutoscalersUpdateCall struct { - s *Service - project string - region string - autoscaler *Autoscaler - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type PublicDelegatedPrefixesWithdrawCall struct { + s *Service + project string + region string + publicDelegatedPrefix string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Updates an autoscaler in the specified project using the data -// included in the request. +// Withdraw: Withdraws the specified PublicDelegatedPrefix in the given region. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall { - c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - publicDelegatedPrefix: The name of the public delegated prefix. It should +// comply with RFC1035. +// - region: The name of the region where the public delegated prefix is +// located. It should comply with RFC1035. +func (r *PublicDelegatedPrefixesService) Withdraw(project string, region string, publicDelegatedPrefix string) *PublicDelegatedPrefixesWithdrawCall { + c := &PublicDelegatedPrefixesWithdrawCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.autoscaler = autoscaler - return c -} - -// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler -// to update. -func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall { - c.urlParams_.Set("autoscaler", autoscaler) + c.publicDelegatedPrefix = publicDelegatedPrefix return c } @@ -58309,7 +58365,7 @@ func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutos // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall { +func (c *PublicDelegatedPrefixesWithdrawCall) RequestId(requestId string) *PublicDelegatedPrefixesWithdrawCall { c.urlParams_.Set("requestId", requestId) return c } @@ -58317,55 +58373,52 @@ func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutosca // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall { +func (c *PublicDelegatedPrefixesWithdrawCall) Fields(s ...googleapi.Field) *PublicDelegatedPrefixesWithdrawCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall { +func (c *PublicDelegatedPrefixesWithdrawCall) Context(ctx context.Context) *PublicDelegatedPrefixesWithdrawCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionAutoscalersUpdateCall) Header() http.Header { +func (c *PublicDelegatedPrefixesWithdrawCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *PublicDelegatedPrefixesWithdrawCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/publicDelegatedPrefixes/{publicDelegatedPrefix}/withdraw") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "publicDelegatedPrefix": c.publicDelegatedPrefix, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionAutoscalers.update" call. +// Do executes the "compute.publicDelegatedPrefixes.withdraw" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *PublicDelegatedPrefixesWithdrawCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { diff --git a/vendor/google.golang.org/api/compute/v1/compute3-gen.go b/vendor/google.golang.org/api/compute/v1/compute3-gen.go index 1e08b6980c5aa..e4b814610e8a4 100644 --- a/vendor/google.golang.org/api/compute/v1/compute3-gen.go +++ b/vendor/google.golang.org/api/compute/v1/compute3-gen.go @@ -16,26 +16,26 @@ import ( gensupport "google.golang.org/api/internal/gensupport" ) -type RegionBackendServicesDeleteCall struct { - s *Service - project string - region string - backendService string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionAutoscalersDeleteCall struct { + s *Service + project string + region string + autoscaler string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified regional BackendService resource. +// Delete: Deletes the specified autoscaler. // -// - backendService: Name of the BackendService resource to delete. +// - autoscaler: Name of the autoscaler to delete. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall { - c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionAutoscalersService) Delete(project string, region string, autoscaler string) *RegionAutoscalersDeleteCall { + c := &RegionAutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.backendService = backendService + c.autoscaler = autoscaler return c } @@ -49,7 +49,7 @@ func (r *RegionBackendServicesService) Delete(project string, region string, bac // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall { +func (c *RegionAutoscalersDeleteCall) RequestId(requestId string) *RegionAutoscalersDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -57,32 +57,32 @@ func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBac // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall { +func (c *RegionAutoscalersDeleteCall) Fields(s ...googleapi.Field) *RegionAutoscalersDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall { +func (c *RegionAutoscalersDeleteCall) Context(ctx context.Context) *RegionAutoscalersDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesDeleteCall) Header() http.Header { +func (c *RegionAutoscalersDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionAutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("DELETE", urls, body) if err != nil { @@ -90,19 +90,19 @@ func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, + "project": c.project, + "region": c.region, + "autoscaler": c.autoscaler, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.delete" call. +// Do executes the "compute.regionAutoscalers.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionAutoscalersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -134,34 +134,34 @@ func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type RegionBackendServicesGetCall struct { - s *Service - project string - region string - backendService string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionAutoscalersGetCall struct { + s *Service + project string + region string + autoscaler string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified regional BackendService resource. +// Get: Returns the specified autoscaler. // -// - backendService: Name of the BackendService resource to return. +// - autoscaler: Name of the autoscaler to return. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall { - c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionAutoscalersService) Get(project string, region string, autoscaler string) *RegionAutoscalersGetCall { + c := &RegionAutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.backendService = backendService + c.autoscaler = autoscaler return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall { +func (c *RegionAutoscalersGetCall) Fields(s ...googleapi.Field) *RegionAutoscalersGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -169,27 +169,27 @@ func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBacke // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall { +func (c *RegionAutoscalersGetCall) IfNoneMatch(entityTag string) *RegionAutoscalersGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall { +func (c *RegionAutoscalersGetCall) Context(ctx context.Context) *RegionAutoscalersGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesGetCall) Header() http.Header { +func (c *RegionAutoscalersGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionAutoscalersGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -197,7 +197,7 @@ func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, er var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers/{autoscaler}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -205,19 +205,19 @@ func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, er } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, + "project": c.project, + "region": c.region, + "autoscaler": c.autoscaler, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.get" call. +// Do executes the "compute.regionAutoscalers.get" call. // Any non-2xx status code is an error. Response headers are in either -// *BackendService.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *Autoscaler.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) { +func (c *RegionAutoscalersGetCall) Do(opts ...googleapi.CallOption) (*Autoscaler, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -236,7 +236,7 @@ func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*Backen if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &BackendService{ + ret := &Autoscaler{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -249,66 +249,77 @@ func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*Backen return ret, nil } -type RegionBackendServicesGetHealthCall struct { - s *Service - project string - region string - backendService string - resourcegroupreference *ResourceGroupReference - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionAutoscalersInsertCall struct { + s *Service + project string + region string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// GetHealth: Gets the most recent health check results for this regional -// BackendService. +// Insert: Creates an autoscaler in the specified project using the data +// included in the request. // -// - backendService: Name of the BackendService resource for which to get -// health. -// - project: . -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall { - c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Insert(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersInsertCall { + c := &RegionAutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.backendService = backendService - c.resourcegroupreference = resourcegroupreference + c.autoscaler = autoscaler + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionAutoscalersInsertCall) RequestId(requestId string) *RegionAutoscalersInsertCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall { +func (c *RegionAutoscalersInsertCall) Fields(s ...googleapi.Field) *RegionAutoscalersInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall { +func (c *RegionAutoscalersInsertCall) Context(ctx context.Context) *RegionAutoscalersInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesGetHealthCall) Header() http.Header { +func (c *RegionAutoscalersInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionAutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -316,20 +327,18 @@ func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Respon } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.getHealth" call. +// Do executes the "compute.regionAutoscalers.insert" call. // Any non-2xx status code is an error. Response headers are in either -// *BackendServiceGroupHealth.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionAutoscalersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -348,7 +357,7 @@ func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &BackendServiceGroupHealth{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -361,42 +370,109 @@ func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type RegionBackendServicesGetIamPolicyCall struct { +type RegionAutoscalersListCall struct { s *Service project string region string - resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// List: Retrieves a list of autoscalers contained within the specified region. // // - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionBackendServicesService) GetIamPolicy(project string, region string, resource string) *RegionBackendServicesGetIamPolicyCall { - c := &RegionBackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) List(project string, region string) *RegionAutoscalersListCall { + c := &RegionAutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *RegionBackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionBackendServicesGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionAutoscalersListCall) Filter(filter string) *RegionAutoscalersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionAutoscalersListCall) MaxResults(maxResults int64) *RegionAutoscalersListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionAutoscalersListCall) OrderBy(orderBy string) *RegionAutoscalersListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionAutoscalersListCall) PageToken(pageToken string) *RegionAutoscalersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionAutoscalersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionAutoscalersListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetIamPolicyCall { +func (c *RegionAutoscalersListCall) Fields(s ...googleapi.Field) *RegionAutoscalersListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -404,27 +480,27 @@ func (c *RegionBackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *Re // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionBackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetIamPolicyCall { +func (c *RegionAutoscalersListCall) IfNoneMatch(entityTag string) *RegionAutoscalersListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesGetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesGetIamPolicyCall { +func (c *RegionAutoscalersListCall) Context(ctx context.Context) *RegionAutoscalersListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesGetIamPolicyCall) Header() http.Header { +func (c *RegionAutoscalersListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionAutoscalersListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -432,7 +508,7 @@ func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Res var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -440,19 +516,19 @@ func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.getIamPolicy" call. +// Do executes the "compute.regionAutoscalers.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *RegionAutoscalerList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionAutoscalersListCall) Do(opts ...googleapi.CallOption) (*RegionAutoscalerList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -471,7 +547,7 @@ func (c *RegionBackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &RegionAutoscalerList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -484,27 +560,55 @@ func (c *RegionBackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionBackendServicesInsertCall struct { - s *Service - project string - region string - backendservice *BackendService - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// Insert: Creates a regional BackendService resource in the specified project -// using the data included in the request. For more information, see Backend -// services overview. -// -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall { - c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionAutoscalersListCall) Pages(ctx context.Context, f func(*RegionAutoscalerList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type RegionAutoscalersPatchCall struct { + s *Service + project string + region string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates an autoscaler in the specified project using the data +// included in the request. This method supports PATCH semantics and uses the +// JSON merge patch format and processing rules. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionAutoscalersService) Patch(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersPatchCall { + c := &RegionAutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.backendservice = backendservice + c.autoscaler = autoscaler + return c +} + +// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler +// to patch. +func (c *RegionAutoscalersPatchCall) Autoscaler(autoscaler string) *RegionAutoscalersPatchCall { + c.urlParams_.Set("autoscaler", autoscaler) return c } @@ -518,7 +622,7 @@ func (r *RegionBackendServicesService) Insert(project string, region string, bac // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall { +func (c *RegionAutoscalersPatchCall) RequestId(requestId string) *RegionAutoscalersPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -526,38 +630,38 @@ func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBac // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall { +func (c *RegionAutoscalersPatchCall) Fields(s ...googleapi.Field) *RegionAutoscalersPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall { +func (c *RegionAutoscalersPatchCall) Context(ctx context.Context) *RegionAutoscalersPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesInsertCall) Header() http.Header { +func (c *RegionAutoscalersPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionAutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } @@ -569,12 +673,12 @@ func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.insert" call. +// Do executes the "compute.regionAutoscalers.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionAutoscalersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -606,148 +710,86 @@ func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type RegionBackendServicesListCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionAutoscalersUpdateCall struct { + s *Service + project string + region string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Retrieves the list of regional BackendService resources available to -// the specified project in the given region. +// Update: Updates an autoscaler in the specified project using the data +// included in the request. // // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall { - c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionAutoscalersService) Update(project string, region string, autoscaler *Autoscaler) *RegionAutoscalersUpdateCall { + c := &RegionAutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region + c.autoscaler = autoscaler return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall { - c.urlParams_.Set("pageToken", pageToken) +// Autoscaler sets the optional parameter "autoscaler": Name of the autoscaler +// to update. +func (c *RegionAutoscalersUpdateCall) Autoscaler(autoscaler string) *RegionAutoscalersUpdateCall { + c.urlParams_.Set("autoscaler", autoscaler) return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionBackendServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionBackendServicesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionAutoscalersUpdateCall) RequestId(requestId string) *RegionAutoscalersUpdateCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall { +func (c *RegionAutoscalersUpdateCall) Fields(s ...googleapi.Field) *RegionAutoscalersUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall { +func (c *RegionAutoscalersUpdateCall) Context(ctx context.Context) *RegionAutoscalersUpdateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesListCall) Header() http.Header { +func (c *RegionAutoscalersUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionAutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/autoscalers") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } @@ -759,13 +801,12 @@ func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, e return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.list" call. +// Do executes the "compute.regionAutoscalers.update" call. // Any non-2xx status code is an error. Response headers are in either -// *BackendServiceList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionAutoscalersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -784,7 +825,7 @@ func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*Backe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &BackendServiceList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -797,188 +838,93 @@ func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*Backe return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionBackendServicesListUsableCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionBackendServicesDeleteCall struct { + s *Service + project string + region string + backendService string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListUsable: Retrieves a list of all usable backend services in the specified -// project in the given region. +// Delete: Deletes the specified regional BackendService resource. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. It must be a string that -// meets the requirements in RFC1035. -func (r *RegionBackendServicesService) ListUsable(project string, region string) *RegionBackendServicesListUsableCall { - c := &RegionBackendServicesListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - backendService: Name of the BackendService resource to delete. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) Delete(project string, region string, backendService string) *RegionBackendServicesDeleteCall { + c := &RegionBackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region + c.backendService = backendService return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionBackendServicesListUsableCall) Filter(filter string) *RegionBackendServicesListUsableCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionBackendServicesListUsableCall) MaxResults(maxResults int64) *RegionBackendServicesListUsableCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionBackendServicesListUsableCall) OrderBy(orderBy string) *RegionBackendServicesListUsableCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionBackendServicesListUsableCall) PageToken(pageToken string) *RegionBackendServicesListUsableCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionBackendServicesListUsableCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionBackendServicesListUsableCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionBackendServicesDeleteCall) RequestId(requestId string) *RegionBackendServicesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesListUsableCall) Fields(s ...googleapi.Field) *RegionBackendServicesListUsableCall { +func (c *RegionBackendServicesDeleteCall) Fields(s ...googleapi.Field) *RegionBackendServicesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionBackendServicesListUsableCall) IfNoneMatch(entityTag string) *RegionBackendServicesListUsableCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesListUsableCall) Context(ctx context.Context) *RegionBackendServicesListUsableCall { +func (c *RegionBackendServicesDeleteCall) Context(ctx context.Context) *RegionBackendServicesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesListUsableCall) Header() http.Header { +func (c *RegionBackendServicesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesListUsableCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/listUsable") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.listUsable" call. +// Do executes the "compute.regionBackendServices.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *BackendServiceListUsable.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionBackendServicesListUsableCall) Do(opts ...googleapi.CallOption) (*BackendServiceListUsable, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionBackendServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -997,7 +943,7 @@ func (c *RegionBackendServicesListUsableCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &BackendServiceListUsable{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1010,105 +956,72 @@ func (c *RegionBackendServicesListUsableCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionBackendServicesListUsableCall) Pages(ctx context.Context, f func(*BackendServiceListUsable) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionBackendServicesPatchCall struct { +type RegionBackendServicesGetCall struct { s *Service project string region string backendService string - backendservice *BackendService urlParams_ gensupport.URLParams + ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Patch: Updates the specified regional BackendService resource with the data -// included in the request. For more information, see Understanding backend -// services This method supports PATCH semantics and uses the JSON merge patch -// format and processing rules. +// Get: Returns the specified regional BackendService resource. // -// - backendService: Name of the BackendService resource to patch. +// - backendService: Name of the BackendService resource to return. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall { - c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionBackendServicesService) Get(project string, region string, backendService string) *RegionBackendServicesGetCall { + c := &RegionBackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.backendService = backendService - c.backendservice = backendservice - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall { - c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall { +func (c *RegionBackendServicesGetCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionBackendServicesGetCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall { +func (c *RegionBackendServicesGetCall) Context(ctx context.Context) *RegionBackendServicesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesPatchCall) Header() http.Header { +func (c *RegionBackendServicesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) - if err != nil { - return nil, err +func (c *RegionBackendServicesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -1121,12 +1034,12 @@ func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.patch" call. +// Do executes the "compute.regionBackendServices.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *BackendService.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionBackendServicesGetCall) Do(opts ...googleapi.CallOption) (*BackendService, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1145,7 +1058,7 @@ func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Oper if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &BackendService{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1158,65 +1071,66 @@ func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Oper return ret, nil } -type RegionBackendServicesSetIamPolicyCall struct { +type RegionBackendServicesGetHealthCall struct { s *Service project string region string - resource string - regionsetpolicyrequest *RegionSetPolicyRequest + backendService string + resourcegroupreference *ResourceGroupReference urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// GetHealth: Gets the most recent health check results for this regional +// BackendService. // -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionBackendServicesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionBackendServicesSetIamPolicyCall { - c := &RegionBackendServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - backendService: Name of the BackendService resource for which to get +// health. +// - project: . +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) GetHealth(project string, region string, backendService string, resourcegroupreference *ResourceGroupReference) *RegionBackendServicesGetHealthCall { + c := &RegionBackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.regionsetpolicyrequest = regionsetpolicyrequest + c.backendService = backendService + c.resourcegroupreference = resourcegroupreference return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetIamPolicyCall { +func (c *RegionBackendServicesGetHealthCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetHealthCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesSetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetIamPolicyCall { +func (c *RegionBackendServicesGetHealthCall) Context(ctx context.Context) *RegionBackendServicesGetHealthCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesSetIamPolicyCall) Header() http.Header { +func (c *RegionBackendServicesGetHealthCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/getHealth") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -1224,19 +1138,20 @@ func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.setIamPolicy" call. +// Do executes the "compute.regionBackendServices.getHealth" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *BackendServiceGroupHealth.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionBackendServicesGetHealthCall) Do(opts ...googleapi.CallOption) (*BackendServiceGroupHealth, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1255,7 +1170,7 @@ func (c *RegionBackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &BackendServiceGroupHealth{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1268,194 +1183,80 @@ func (c *RegionBackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionBackendServicesSetSecurityPolicyCall struct { - s *Service - project string - region string - backendService string - securitypolicyreference *SecurityPolicyReference - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionBackendServicesGetIamPolicyCall struct { + s *Service + project string + region string + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetSecurityPolicy: Sets the Google Cloud Armor security policy for the -// specified backend service. For more information, see Google Cloud Armor -// Overview +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // -// - backendService: Name of the BackendService resource to which the security -// policy should be set. The name should conform to RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) SetSecurityPolicy(project string, region string, backendService string, securitypolicyreference *SecurityPolicyReference) *RegionBackendServicesSetSecurityPolicyCall { - c := &RegionBackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionBackendServicesService) GetIamPolicy(project string, region string, resource string) *RegionBackendServicesGetIamPolicyCall { + c := &RegionBackendServicesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.backendService = backendService - c.securitypolicyreference = securitypolicyreference + c.resource = resource return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesSetSecurityPolicyCall) RequestId(requestId string) *RegionBackendServicesSetSecurityPolicyCall { - c.urlParams_.Set("requestId", requestId) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *RegionBackendServicesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionBackendServicesGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetSecurityPolicyCall { +func (c *RegionBackendServicesGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetSecurityPolicyCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) - if err != nil { - return nil, err - } - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Do executes the "compute.regionBackendServices.setSecurityPolicy" call. -// Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &Operation{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - -type RegionBackendServicesTestIamPermissionsCall struct { - s *Service - project string - region string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header -} - -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. -// -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall { - c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.project = project - c.region = region - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionBackendServicesGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionBackendServicesGetIamPolicyCall { + c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall { +func (c *RegionBackendServicesGetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header { +func (c *RegionBackendServicesGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) - if err != nil { - return nil, err +func (c *RegionBackendServicesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -1468,13 +1269,12 @@ func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*ht return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.testIamPermissions" call. +// Do executes the "compute.regionBackendServices.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionBackendServicesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1493,7 +1293,7 @@ func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallO if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1506,29 +1306,26 @@ func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallO return ret, nil } -type RegionBackendServicesUpdateCall struct { +type RegionBackendServicesInsertCall struct { s *Service project string region string - backendService string backendservice *BackendService urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates the specified regional BackendService resource with the data -// included in the request. For more information, see Backend services overview -// . +// Insert: Creates a regional BackendService resource in the specified project +// using the data included in the request. For more information, see Backend +// services overview. // -// - backendService: Name of the BackendService resource to update. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall { - c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionBackendServicesService) Insert(project string, region string, backendservice *BackendService) *RegionBackendServicesInsertCall { + c := &RegionBackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.backendService = backendService c.backendservice = backendservice return c } @@ -1543,7 +1340,7 @@ func (r *RegionBackendServicesService) Update(project string, region string, bac // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall { +func (c *RegionBackendServicesInsertCall) RequestId(requestId string) *RegionBackendServicesInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -1551,27 +1348,27 @@ func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBac // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall { +func (c *RegionBackendServicesInsertCall) Fields(s ...googleapi.Field) *RegionBackendServicesInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall { +func (c *RegionBackendServicesInsertCall) Context(ctx context.Context) *RegionBackendServicesInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionBackendServicesUpdateCall) Header() http.Header { +func (c *RegionBackendServicesInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) @@ -1580,27 +1377,26 @@ func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "backendService": c.backendService, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionBackendServices.update" call. +// Do executes the "compute.regionBackendServices.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionBackendServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1632,23 +1428,25 @@ func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Ope return ret, nil } -type RegionCommitmentsAggregatedListCall struct { +type RegionBackendServicesListCall struct { s *Service project string + region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// AggregatedList: Retrieves an aggregated list of commitments by region. To -// prevent failure, Google recommends that you set the `returnPartialSuccess` -// parameter to `true`. +// List: Retrieves the list of regional BackendService resources available to +// the specified project in the given region. // // - project: Project ID for this request. -func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall { - c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) List(project string, region string) *RegionBackendServicesListCall { + c := &RegionBackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.region = region return c } @@ -1684,30 +1482,17 @@ func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitm // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) Filter(filter string) *RegionBackendServicesListCall { c.urlParams_.Set("filter", filter) return c } -// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates -// whether every visible scope for each scope type (zone, region, global) -// should be included in the response. For new resource types added after this -// field, the flag has no effect as new resource types will always include -// every visible scope for each scope type in response. For resource types -// which predate this field, if this flag is omitted or false, only scopes of -// the scope types where the resource type is expected to be found will be -// included. -func (c *RegionCommitmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *RegionCommitmentsAggregatedListCall { - c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) - return c -} - // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) MaxResults(maxResults int64) *RegionBackendServicesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -1720,7 +1505,7 @@ func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *Regi // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) OrderBy(orderBy string) *RegionBackendServicesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -1728,7 +1513,7 @@ func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCom // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) PageToken(pageToken string) *RegionBackendServicesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -1738,23 +1523,15 @@ func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *Regio // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *RegionCommitmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionBackendServicesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } -// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The -// Shared VPC service project id or service project number for which aggregated -// list request is invoked for subnetworks list-usable api. -func (c *RegionCommitmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *RegionCommitmentsAggregatedListCall { - c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) Fields(s ...googleapi.Field) *RegionBackendServicesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -1762,27 +1539,27 @@ func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *Regi // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) IfNoneMatch(entityTag string) *RegionBackendServicesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall { +func (c *RegionBackendServicesListCall) Context(ctx context.Context) *RegionBackendServicesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionCommitmentsAggregatedListCall) Header() http.Header { +func (c *RegionBackendServicesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -1790,7 +1567,7 @@ func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Respo var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/commitments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -1799,17 +1576,18 @@ func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Respo req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionCommitments.aggregatedList" call. +// Do executes the "compute.regionBackendServices.list" call. // Any non-2xx status code is an error. Response headers are in either -// *CommitmentAggregatedList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) { +// *BackendServiceList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionBackendServicesListCall) Do(opts ...googleapi.CallOption) (*BackendServiceList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1828,7 +1606,7 @@ func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CommitmentAggregatedList{ + ret := &BackendServiceList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1844,7 +1622,7 @@ func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) ( // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error { +func (c *RegionBackendServicesListCall) Pages(ctx context.Context, f func(*BackendServiceList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -1862,34 +1640,111 @@ func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func( } } -type RegionCommitmentsGetCall struct { +type RegionBackendServicesListUsableCall struct { s *Service project string region string - commitment string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns the specified commitment resource. +// ListUsable: Retrieves a list of all usable backend services in the specified +// project in the given region. // -// - commitment: Name of the commitment to return. -// - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall { - c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region scoping this request. It must be a string that +// meets the requirements in RFC1035. +func (r *RegionBackendServicesService) ListUsable(project string, region string) *RegionBackendServicesListUsableCall { + c := &RegionBackendServicesListUsableCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.commitment = commitment + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionBackendServicesListUsableCall) Filter(filter string) *RegionBackendServicesListUsableCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionBackendServicesListUsableCall) MaxResults(maxResults int64) *RegionBackendServicesListUsableCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionBackendServicesListUsableCall) OrderBy(orderBy string) *RegionBackendServicesListUsableCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionBackendServicesListUsableCall) PageToken(pageToken string) *RegionBackendServicesListUsableCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionBackendServicesListUsableCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionBackendServicesListUsableCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall { +func (c *RegionBackendServicesListUsableCall) Fields(s ...googleapi.Field) *RegionBackendServicesListUsableCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -1897,27 +1752,27 @@ func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmen // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall { +func (c *RegionBackendServicesListUsableCall) IfNoneMatch(entityTag string) *RegionBackendServicesListUsableCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall { +func (c *RegionBackendServicesListUsableCall) Context(ctx context.Context) *RegionBackendServicesListUsableCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionCommitmentsGetCall) Header() http.Header { +func (c *RegionBackendServicesListUsableCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesListUsableCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -1925,7 +1780,7 @@ func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/listUsable") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -1933,19 +1788,19 @@ func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "commitment": c.commitment, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionCommitments.get" call. +// Do executes the "compute.regionBackendServices.listUsable" call. // Any non-2xx status code is an error. Response headers are in either -// *Commitment.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) { +// *BackendServiceListUsable.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionBackendServicesListUsableCall) Do(opts ...googleapi.CallOption) (*BackendServiceListUsable, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -1964,7 +1819,7 @@ func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Commitment{ + ret := &BackendServiceListUsable{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -1977,26 +1832,52 @@ func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment return ret, nil } -type RegionCommitmentsInsertCall struct { - s *Service - project string - region string - commitment *Commitment - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionBackendServicesListUsableCall) Pages(ctx context.Context, f func(*BackendServiceListUsable) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Insert: Creates a commitment in the specified project using the data -// included in the request. +type RegionBackendServicesPatchCall struct { + s *Service + project string + region string + backendService string + backendservice *BackendService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates the specified regional BackendService resource with the data +// included in the request. For more information, see Understanding backend +// services This method supports PATCH semantics and uses the JSON merge patch +// format and processing rules. // +// - backendService: Name of the BackendService resource to patch. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall { - c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) Patch(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesPatchCall { + c := &RegionBackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.commitment = commitment + c.backendService = backendService + c.backendservice = backendservice return c } @@ -2010,7 +1891,7 @@ func (r *RegionCommitmentsService) Insert(project string, region string, commitm // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall { +func (c *RegionBackendServicesPatchCall) RequestId(requestId string) *RegionBackendServicesPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -2018,55 +1899,56 @@ func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitm // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall { +func (c *RegionBackendServicesPatchCall) Fields(s ...googleapi.Field) *RegionBackendServicesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall { +func (c *RegionBackendServicesPatchCall) Context(ctx context.Context) *RegionBackendServicesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionCommitmentsInsertCall) Header() http.Header { +func (c *RegionBackendServicesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionCommitments.insert" call. +// Do executes the "compute.regionBackendServices.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionBackendServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2098,164 +1980,85 @@ func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionCommitmentsListCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionBackendServicesSetIamPolicyCall struct { + s *Service + project string + region string + resource string + regionsetpolicyrequest *RegionSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Retrieves a list of commitments contained within the specified region. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall { - c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionBackendServicesService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionBackendServicesSetIamPolicyCall { + c := &RegionBackendServicesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionCommitmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionCommitmentsListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + c.resource = resource + c.regionsetpolicyrequest = regionsetpolicyrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall { +func (c *RegionBackendServicesSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall { +func (c *RegionBackendServicesSetIamPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionCommitmentsListCall) Header() http.Header { +func (c *RegionBackendServicesSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionBackendServicesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionCommitments.list" call. +// Do executes the "compute.regionBackendServices.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *CommitmentList.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *Policy.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) { +func (c *RegionBackendServicesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2274,7 +2077,7 @@ func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*Commitmen if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &CommitmentList{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2287,57 +2090,31 @@ func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*Commitmen return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionCommitmentsUpdateCall struct { - s *Service - project string - region string - commitment string - commitment2 *Commitment - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionBackendServicesSetSecurityPolicyCall struct { + s *Service + project string + region string + backendService string + securitypolicyreference *SecurityPolicyReference + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Updates the specified commitment with the data included in the -// request. Update is performed only on selected fields included as part of -// update-mask. Only the following fields can be modified: auto_renew. +// SetSecurityPolicy: Sets the Google Cloud Armor security policy for the +// specified backend service. For more information, see Google Cloud Armor +// Overview // -// - commitment: Name of the commitment for which auto renew is being updated. -// - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionCommitmentsService) Update(project string, region string, commitment string, commitment2 *Commitment) *RegionCommitmentsUpdateCall { - c := &RegionCommitmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - backendService: Name of the BackendService resource to which the security +// policy should be set. The name should conform to RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) SetSecurityPolicy(project string, region string, backendService string, securitypolicyreference *SecurityPolicyReference) *RegionBackendServicesSetSecurityPolicyCall { + c := &RegionBackendServicesSetSecurityPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.commitment = commitment - c.commitment2 = commitment2 - return c -} - -// Paths sets the optional parameter "paths": -func (c *RegionCommitmentsUpdateCall) Paths(paths ...string) *RegionCommitmentsUpdateCall { - c.urlParams_.SetMulti("paths", append([]string{}, paths...)) + c.backendService = backendService + c.securitypolicyreference = securitypolicyreference return c } @@ -2351,71 +2128,64 @@ func (c *RegionCommitmentsUpdateCall) Paths(paths ...string) *RegionCommitmentsU // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionCommitmentsUpdateCall) RequestId(requestId string) *RegionCommitmentsUpdateCall { +func (c *RegionBackendServicesSetSecurityPolicyCall) RequestId(requestId string) *RegionBackendServicesSetSecurityPolicyCall { c.urlParams_.Set("requestId", requestId) return c } -// UpdateMask sets the optional parameter "updateMask": update_mask indicates -// fields to be updated as part of this request. -func (c *RegionCommitmentsUpdateCall) UpdateMask(updateMask string) *RegionCommitmentsUpdateCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionCommitmentsUpdateCall) Fields(s ...googleapi.Field) *RegionCommitmentsUpdateCall { +func (c *RegionBackendServicesSetSecurityPolicyCall) Fields(s ...googleapi.Field) *RegionBackendServicesSetSecurityPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionCommitmentsUpdateCall) Context(ctx context.Context) *RegionCommitmentsUpdateCall { +func (c *RegionBackendServicesSetSecurityPolicyCall) Context(ctx context.Context) *RegionBackendServicesSetSecurityPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionCommitmentsUpdateCall) Header() http.Header { +func (c *RegionBackendServicesSetSecurityPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionCommitmentsUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionBackendServicesSetSecurityPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment2) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.securitypolicyreference) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}/setSecurityPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "commitment": c.commitment, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionCommitments.update" call. +// Do executes the "compute.regionBackendServices.setSecurityPolicy" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionCommitmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionBackendServicesSetSecurityPolicyCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2447,90 +2217,212 @@ func (c *RegionCommitmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionDiskTypesGetCall struct { - s *Service - project string - region string - diskType string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionBackendServicesTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified regional disk type. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // -// - diskType: Name of the disk type to return. // - project: Project ID for this request. // - region: The name of the region for this request. -func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall { - c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *RegionBackendServicesService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionBackendServicesTestIamPermissionsCall { + c := &RegionBackendServicesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.diskType = diskType + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall { +func (c *RegionBackendServicesTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionBackendServicesTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall { - c.ifNoneMatch_ = entityTag +// Context sets the context to be used in this call's Do method. +func (c *RegionBackendServicesTestIamPermissionsCall) Context(ctx context.Context) *RegionBackendServicesTestIamPermissionsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionBackendServicesTestIamPermissionsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionBackendServicesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionBackendServices.testIamPermissions" call. +// Any non-2xx status code is an error. Response headers are in either +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionBackendServicesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &TestPermissionsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type RegionBackendServicesUpdateCall struct { + s *Service + project string + region string + backendService string + backendservice *BackendService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Updates the specified regional BackendService resource with the data +// included in the request. For more information, see Backend services overview +// . +// +// - backendService: Name of the BackendService resource to update. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionBackendServicesService) Update(project string, region string, backendService string, backendservice *BackendService) *RegionBackendServicesUpdateCall { + c := &RegionBackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.backendService = backendService + c.backendservice = backendservice + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionBackendServicesUpdateCall) RequestId(requestId string) *RegionBackendServicesUpdateCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionBackendServicesUpdateCall) Fields(s ...googleapi.Field) *RegionBackendServicesUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall { +func (c *RegionBackendServicesUpdateCall) Context(ctx context.Context) *RegionBackendServicesUpdateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDiskTypesGetCall) Header() http.Header { +func (c *RegionBackendServicesUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionBackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes/{diskType}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/backendServices/{backendService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "diskType": c.diskType, + "project": c.project, + "region": c.region, + "backendService": c.backendService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDiskTypes.get" call. +// Do executes the "compute.regionBackendServices.update" call. // Any non-2xx status code is an error. Response headers are in either -// *DiskType.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) { +func (c *RegionBackendServicesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2549,7 +2441,7 @@ func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &DiskType{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2562,25 +2454,23 @@ func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, er return ret, nil } -type RegionDiskTypesListCall struct { +type RegionCommitmentsAggregatedListCall struct { s *Service project string - region string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// List: Retrieves a list of regional disk types available to the specified -// project. +// AggregatedList: Retrieves an aggregated list of commitments by region. To +// prevent failure, Google recommends that you set the `returnPartialSuccess` +// parameter to `true`. // // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall { - c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionCommitmentsService) AggregatedList(project string) *RegionCommitmentsAggregatedListCall { + c := &RegionCommitmentsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.region = region return c } @@ -2616,17 +2506,30 @@ func (r *RegionDiskTypesService) List(project string, region string) *RegionDisk // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) Filter(filter string) *RegionCommitmentsAggregatedListCall { c.urlParams_.Set("filter", filter) return c } +// IncludeAllScopes sets the optional parameter "includeAllScopes": Indicates +// whether every visible scope for each scope type (zone, region, global) +// should be included in the response. For new resource types added after this +// field, the flag has no effect as new resource types will always include +// every visible scope for each scope type in response. For resource types +// which predate this field, if this flag is omitted or false, only scopes of +// the scope types where the resource type is expected to be found will be +// included. +func (c *RegionCommitmentsAggregatedListCall) IncludeAllScopes(includeAllScopes bool) *RegionCommitmentsAggregatedListCall { + c.urlParams_.Set("includeAllScopes", fmt.Sprint(includeAllScopes)) + return c +} + // MaxResults sets the optional parameter "maxResults": The maximum number of // results per page that should be returned. If the number of available results // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) MaxResults(maxResults int64) *RegionCommitmentsAggregatedListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -2639,7 +2542,7 @@ func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesL // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) OrderBy(orderBy string) *RegionCommitmentsAggregatedListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -2647,7 +2550,7 @@ func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCa // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) PageToken(pageToken string) *RegionCommitmentsAggregatedListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -2657,15 +2560,23 @@ func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesLi // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *RegionDiskTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionCommitmentsAggregatedListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } +// ServiceProjectNumber sets the optional parameter "serviceProjectNumber": The +// Shared VPC service project id or service project number for which aggregated +// list request is invoked for subnetworks list-usable api. +func (c *RegionCommitmentsAggregatedListCall) ServiceProjectNumber(serviceProjectNumber int64) *RegionCommitmentsAggregatedListCall { + c.urlParams_.Set("serviceProjectNumber", fmt.Sprint(serviceProjectNumber)) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) Fields(s ...googleapi.Field) *RegionCommitmentsAggregatedListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -2673,27 +2584,27 @@ func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesL // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) IfNoneMatch(entityTag string) *RegionCommitmentsAggregatedListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall { +func (c *RegionCommitmentsAggregatedListCall) Context(ctx context.Context) *RegionCommitmentsAggregatedListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDiskTypesListCall) Header() http.Header { +func (c *RegionCommitmentsAggregatedListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionCommitmentsAggregatedListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -2701,7 +2612,7 @@ func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/aggregated/commitments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -2710,18 +2621,17 @@ func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ "project": c.project, - "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDiskTypes.list" call. +// Do executes the "compute.regionCommitments.aggregatedList" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionDiskTypeList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) { +// *CommitmentAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionCommitmentsAggregatedListCall) Do(opts ...googleapi.CallOption) (*CommitmentAggregatedList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2740,7 +2650,7 @@ func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskT if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionDiskTypeList{ + ret := &CommitmentAggregatedList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2756,7 +2666,7 @@ func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskT // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error { +func (c *RegionCommitmentsAggregatedListCall) Pages(ctx context.Context, f func(*CommitmentAggregatedList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -2774,101 +2684,90 @@ func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskT } } -type RegionDisksAddResourcePoliciesCall struct { - s *Service - project string - region string - disk string - regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionCommitmentsGetCall struct { + s *Service + project string + region string + commitment string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// AddResourcePolicies: Adds existing resource policies to a regional disk. You -// can only add one policy which will be applied to this disk for scheduling -// snapshot creation. +// Get: Returns the specified commitment resource. // -// - disk: The disk name for this request. +// - commitment: Name of the commitment to return. // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall { - c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *RegionCommitmentsService) Get(project string, region string, commitment string) *RegionCommitmentsGetCall { + c := &RegionCommitmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disk = disk - c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall { - c.urlParams_.Set("requestId", requestId) + c.commitment = commitment return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall { +func (c *RegionCommitmentsGetCall) Fields(s ...googleapi.Field) *RegionCommitmentsGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionCommitmentsGetCall) IfNoneMatch(entityTag string) *RegionCommitmentsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall { +func (c *RegionCommitmentsGetCall) Context(ctx context.Context) *RegionCommitmentsGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header { +func (c *RegionCommitmentsGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest) - if err != nil { - return nil, err +func (c *RegionCommitmentsGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "disk": c.disk, + "project": c.project, + "region": c.region, + "commitment": c.commitment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.addResourcePolicies" call. +// Do executes the "compute.regionCommitments.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Commitment.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionCommitmentsGetCall) Do(opts ...googleapi.CallOption) (*Commitment, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -2887,7 +2786,7 @@ func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Commitment{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -2900,25 +2799,26 @@ func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type RegionDisksBulkInsertCall struct { - s *Service - project string - region string - bulkinsertdiskresource *BulkInsertDiskResource - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionCommitmentsInsertCall struct { + s *Service + project string + region string + commitment *Commitment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// BulkInsert: Bulk create a set of disks. +// Insert: Creates a commitment in the specified project using the data +// included in the request. // // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *RegionDisksService) BulkInsert(project string, region string, bulkinsertdiskresource *BulkInsertDiskResource) *RegionDisksBulkInsertCall { - c := &RegionDisksBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *RegionCommitmentsService) Insert(project string, region string, commitment *Commitment) *RegionCommitmentsInsertCall { + c := &RegionCommitmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.bulkinsertdiskresource = bulkinsertdiskresource + c.commitment = commitment return c } @@ -2932,7 +2832,7 @@ func (r *RegionDisksService) BulkInsert(project string, region string, bulkinser // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksBulkInsertCall) RequestId(requestId string) *RegionDisksBulkInsertCall { +func (c *RegionCommitmentsInsertCall) RequestId(requestId string) *RegionCommitmentsInsertCall { c.urlParams_.Set("requestId", requestId) return c } @@ -2940,36 +2840,36 @@ func (c *RegionDisksBulkInsertCall) RequestId(requestId string) *RegionDisksBulk // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksBulkInsertCall) Fields(s ...googleapi.Field) *RegionDisksBulkInsertCall { +func (c *RegionCommitmentsInsertCall) Fields(s ...googleapi.Field) *RegionCommitmentsInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksBulkInsertCall) Context(ctx context.Context) *RegionDisksBulkInsertCall { +func (c *RegionCommitmentsInsertCall) Context(ctx context.Context) *RegionCommitmentsInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksBulkInsertCall) Header() http.Header { +func (c *RegionCommitmentsInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionCommitmentsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/bulkInsert") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -2983,12 +2883,12 @@ func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.bulkInsert" call. +// Do executes the "compute.regionCommitments.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionCommitmentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3020,84 +2920,147 @@ func (c *RegionDisksBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation return ret, nil } -type RegionDisksCreateSnapshotCall struct { - s *Service - project string - region string - disk string - snapshot *Snapshot - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionCommitmentsListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// CreateSnapshot: Creates a snapshot of a specified persistent disk. For -// regular snapshot creation, consider using snapshots.insert instead, as that -// method supports more features, such as creating snapshots in a project -// different from the source disk project. +// List: Retrieves a list of commitments contained within the specified region. // -// - disk: Name of the regional persistent disk to snapshot. // - project: Project ID for this request. // - region: Name of the region for this request. -func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall { - c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionCommitmentsService) List(project string, region string) *RegionCommitmentsListCall { + c := &RegionCommitmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disk = disk - c.snapshot = snapshot return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionCommitmentsListCall) Filter(filter string) *RegionCommitmentsListCall { + c.urlParams_.Set("filter", filter) return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionCommitmentsListCall) MaxResults(maxResults int64) *RegionCommitmentsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// Context sets the context to be used in this call's Do method. -func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall { - c.ctx_ = ctx +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionCommitmentsListCall) OrderBy(orderBy string) *RegionCommitmentsListCall { + c.urlParams_.Set("orderBy", orderBy) return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionDisksCreateSnapshotCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionCommitmentsListCall) PageToken(pageToken string) *RegionCommitmentsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c } -func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) - if err != nil { - return nil, err +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionCommitmentsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionCommitmentsListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionCommitmentsListCall) Fields(s ...googleapi.Field) *RegionCommitmentsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionCommitmentsListCall) IfNoneMatch(entityTag string) *RegionCommitmentsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionCommitmentsListCall) Context(ctx context.Context) *RegionCommitmentsListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionCommitmentsListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionCommitmentsListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/createSnapshot") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -3105,17 +3068,16 @@ func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, e googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, - "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.createSnapshot" call. +// Do executes the "compute.regionCommitments.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// *CommitmentList.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionCommitmentsListCall) Do(opts ...googleapi.CallOption) (*CommitmentList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3134,7 +3096,7 @@ func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Opera if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &CommitmentList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3147,29 +3109,57 @@ func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Opera return ret, nil } -type RegionDisksDeleteCall struct { - s *Service - project string - region string - disk string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionCommitmentsListCall) Pages(ctx context.Context, f func(*CommitmentList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Delete: Deletes the specified regional persistent disk. Deleting a regional -// disk removes all the replicas of its data permanently and is irreversible. -// However, deleting a disk does not delete any snapshots previously made from -// the disk. You must separately delete snapshots. +type RegionCommitmentsUpdateCall struct { + s *Service + project string + region string + commitment string + commitment2 *Commitment + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Update: Updates the specified commitment with the data included in the +// request. Update is performed only on selected fields included as part of +// update-mask. Only the following fields can be modified: auto_renew. // -// - disk: Name of the regional persistent disk to delete. +// - commitment: Name of the commitment for which auto renew is being updated. // - project: Project ID for this request. // - region: Name of the region for this request. -func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall { - c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionCommitmentsService) Update(project string, region string, commitment string, commitment2 *Commitment) *RegionCommitmentsUpdateCall { + c := &RegionCommitmentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disk = disk + c.commitment = commitment + c.commitment2 = commitment2 + return c +} + +// Paths sets the optional parameter "paths": +func (c *RegionCommitmentsUpdateCall) Paths(paths ...string) *RegionCommitmentsUpdateCall { + c.urlParams_.SetMulti("paths", append([]string{}, paths...)) return c } @@ -3183,60 +3173,71 @@ func (r *RegionDisksService) Delete(project string, region string, disk string) // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall { +func (c *RegionCommitmentsUpdateCall) RequestId(requestId string) *RegionCommitmentsUpdateCall { c.urlParams_.Set("requestId", requestId) return c } +// UpdateMask sets the optional parameter "updateMask": update_mask indicates +// fields to be updated as part of this request. +func (c *RegionCommitmentsUpdateCall) UpdateMask(updateMask string) *RegionCommitmentsUpdateCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall { +func (c *RegionCommitmentsUpdateCall) Fields(s ...googleapi.Field) *RegionCommitmentsUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall { +func (c *RegionCommitmentsUpdateCall) Context(ctx context.Context) *RegionCommitmentsUpdateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksDeleteCall) Header() http.Header { +func (c *RegionCommitmentsUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *RegionCommitmentsUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitment2) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/commitments/{commitment}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "disk": c.disk, + "project": c.project, + "region": c.region, + "commitment": c.commitment, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.delete" call. +// Do executes the "compute.regionCommitments.update" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionCommitmentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3268,34 +3269,34 @@ func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, er return ret, nil } -type RegionDisksGetCall struct { +type RegionDiskTypesGetCall struct { s *Service project string region string - disk string + diskType string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// Get: Returns a specified regional persistent disk. +// Get: Returns the specified regional disk type. // -// - disk: Name of the regional persistent disk to return. +// - diskType: Name of the disk type to return. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall { - c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *RegionDiskTypesService) Get(project string, region string, diskType string) *RegionDiskTypesGetCall { + c := &RegionDiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disk = disk + c.diskType = diskType return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall { +func (c *RegionDiskTypesGetCall) Fields(s ...googleapi.Field) *RegionDiskTypesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3303,27 +3304,27 @@ func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall { // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall { +func (c *RegionDiskTypesGetCall) IfNoneMatch(entityTag string) *RegionDiskTypesGetCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall { +func (c *RegionDiskTypesGetCall) Context(ctx context.Context) *RegionDiskTypesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksGetCall) Header() http.Header { +func (c *RegionDiskTypesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDiskTypesGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -3331,7 +3332,7 @@ func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes/{diskType}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -3339,19 +3340,19 @@ func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "disk": c.disk, + "project": c.project, + "region": c.region, + "diskType": c.diskType, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.get" call. +// Do executes the "compute.regionDiskTypes.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Disk.ServerResponse.Header or (if a response was returned at all) in +// *DiskType.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) { +func (c *RegionDiskTypesGetCall) Do(opts ...googleapi.CallOption) (*DiskType, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3370,7 +3371,7 @@ func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Disk{ + ret := &DiskType{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3383,42 +3384,110 @@ func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) { return ret, nil } -type RegionDisksGetIamPolicyCall struct { +type RegionDiskTypesListCall struct { s *Service project string region string - resource string urlParams_ gensupport.URLParams ifNoneMatch_ string ctx_ context.Context header_ http.Header } -// GetIamPolicy: Gets the access control policy for a resource. May be empty if -// no such policy or resource exists. +// List: Retrieves a list of regional disk types available to the specified +// project. // // - project: Project ID for this request. // - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionDisksService) GetIamPolicy(project string, region string, resource string) *RegionDisksGetIamPolicyCall { - c := &RegionDisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionDiskTypesService) List(project string, region string) *RegionDiskTypesListCall { + c := &RegionDiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource return c } -// OptionsRequestedPolicyVersion sets the optional parameter -// "optionsRequestedPolicyVersion": Requested IAM Policy version. -func (c *RegionDisksGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionDisksGetIamPolicyCall { - c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionDiskTypesListCall) Filter(filter string) *RegionDiskTypesListCall { + c.urlParams_.Set("filter", filter) return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionDiskTypesListCall) MaxResults(maxResults int64) *RegionDiskTypesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionDiskTypesListCall) OrderBy(orderBy string) *RegionDiskTypesListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionDiskTypesListCall) PageToken(pageToken string) *RegionDiskTypesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionDiskTypesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionDiskTypesListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksGetIamPolicyCall { +func (c *RegionDiskTypesListCall) Fields(s ...googleapi.Field) *RegionDiskTypesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -3426,27 +3495,27 @@ func (c *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksG // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionDisksGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionDisksGetIamPolicyCall { +func (c *RegionDiskTypesListCall) IfNoneMatch(entityTag string) *RegionDiskTypesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksGetIamPolicyCall) Context(ctx context.Context) *RegionDisksGetIamPolicyCall { +func (c *RegionDiskTypesListCall) Context(ctx context.Context) *RegionDiskTypesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksGetIamPolicyCall) Header() http.Header { +func (c *RegionDiskTypesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDiskTypesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -3454,7 +3523,7 @@ func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, err var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/diskTypes") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -3462,19 +3531,19 @@ func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.getIamPolicy" call. +// Do executes the "compute.regionDiskTypes.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +// *RegionDiskTypeList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionDiskTypesListCall) Do(opts ...googleapi.CallOption) (*RegionDiskTypeList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3493,7 +3562,7 @@ func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &RegionDiskTypeList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3506,26 +3575,51 @@ func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, return ret, nil } -type RegionDisksInsertCall struct { - s *Service - project string - region string - disk *Disk - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionDiskTypesListCall) Pages(ctx context.Context, f func(*RegionDiskTypeList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Insert: Creates a persistent regional disk in the specified project using -// the data included in the request. +type RegionDisksAddResourcePoliciesCall struct { + s *Service + project string + region string + disk string + regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// AddResourcePolicies: Adds existing resource policies to a regional disk. You +// can only add one policy which will be applied to this disk for scheduling +// snapshot creation. // +// - disk: The disk name for this request. // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall { - c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *RegionDisksService) AddResourcePolicies(project string, region string, disk string, regiondisksaddresourcepoliciesrequest *RegionDisksAddResourcePoliciesRequest) *RegionDisksAddResourcePoliciesCall { + c := &RegionDisksAddResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.disk = disk + c.regiondisksaddresourcepoliciesrequest = regiondisksaddresourcepoliciesrequest return c } @@ -3539,51 +3633,44 @@ func (r *RegionDisksService) Insert(project string, region string, disk *Disk) * // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall { +func (c *RegionDisksAddResourcePoliciesCall) RequestId(requestId string) *RegionDisksAddResourcePoliciesCall { c.urlParams_.Set("requestId", requestId) return c } -// SourceImage sets the optional parameter "sourceImage": Source image to -// restore onto a disk. This field is optional. -func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall { - c.urlParams_.Set("sourceImage", sourceImage) - return c -} - // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall { +func (c *RegionDisksAddResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksAddResourcePoliciesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall { +func (c *RegionDisksAddResourcePoliciesCall) Context(ctx context.Context) *RegionDisksAddResourcePoliciesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksInsertCall) Header() http.Header { +func (c *RegionDisksAddResourcePoliciesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksAddResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksaddresourcepoliciesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/addResourcePolicies") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3593,16 +3680,17 @@ func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.insert" call. +// Do executes the "compute.regionDisks.addResourcePolicies" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksAddResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3634,148 +3722,78 @@ func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, er return ret, nil } -type RegionDisksListCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionDisksBulkInsertCall struct { + s *Service + project string + region string + bulkinsertdiskresource *BulkInsertDiskResource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Retrieves the list of persistent disks contained within the specified -// region. +// BulkInsert: Bulk create a set of disks. // // - project: Project ID for this request. -// - region: Name of the region for this request. -func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall { - c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *RegionDisksService) BulkInsert(project string, region string, bulkinsertdiskresource *BulkInsertDiskResource) *RegionDisksBulkInsertCall { + c := &RegionDisksBulkInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region + c.bulkinsertdiskresource = bulkinsertdiskresource return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionDisksBulkInsertCall) RequestId(requestId string) *RegionDisksBulkInsertCall { + c.urlParams_.Set("requestId", requestId) return c } -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall { - c.urlParams_.Set("orderBy", orderBy) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionDisksBulkInsertCall) Fields(s ...googleapi.Field) *RegionDisksBulkInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionDisksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionDisksListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall { - c.ctx_ = ctx +// Context sets the context to be used in this call's Do method. +func (c *RegionDisksBulkInsertCall) Context(ctx context.Context) *RegionDisksBulkInsertCall { + c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksListCall) Header() http.Header { +func (c *RegionDisksBulkInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionDisksBulkInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.bulkinsertdiskresource) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/bulkInsert") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -3787,12 +3805,12 @@ func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.list" call. +// Do executes the "compute.regionDisks.bulkInsert" call. // Any non-2xx status code is an error. Response headers are in either -// *DiskList.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) { +func (c *RegionDisksBulkInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3811,7 +3829,7 @@ func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &DiskList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -3824,49 +3842,31 @@ func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionDisksRemoveResourcePoliciesCall struct { - s *Service - project string - region string - disk string - regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksCreateSnapshotCall struct { + s *Service + project string + region string + disk string + snapshot *Snapshot + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RemoveResourcePolicies: Removes resource policies from a regional disk. +// CreateSnapshot: Creates a snapshot of a specified persistent disk. For +// regular snapshot creation, consider using snapshots.insert instead, as that +// method supports more features, such as creating snapshots in a project +// different from the source disk project. // -// - disk: The disk name for this request. +// - disk: Name of the regional persistent disk to snapshot. // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall { - c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *RegionDisksService) CreateSnapshot(project string, region string, disk string, snapshot *Snapshot) *RegionDisksCreateSnapshotCall { + c := &RegionDisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.disk = disk - c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest + c.snapshot = snapshot return c } @@ -3880,7 +3880,7 @@ func (r *RegionDisksService) RemoveResourcePolicies(project string, region strin // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall { +func (c *RegionDisksCreateSnapshotCall) RequestId(requestId string) *RegionDisksCreateSnapshotCall { c.urlParams_.Set("requestId", requestId) return c } @@ -3888,36 +3888,36 @@ func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *Reg // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall { +func (c *RegionDisksCreateSnapshotCall) Fields(s ...googleapi.Field) *RegionDisksCreateSnapshotCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall { +func (c *RegionDisksCreateSnapshotCall) Context(ctx context.Context) *RegionDisksCreateSnapshotCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header { +func (c *RegionDisksCreateSnapshotCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/createSnapshot") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -3932,12 +3932,12 @@ func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.removeResourcePolicies" call. +// Do executes the "compute.regionDisks.createSnapshot" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksCreateSnapshotCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -3969,28 +3969,29 @@ func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionDisksResizeCall struct { - s *Service - project string - region string - disk string - regiondisksresizerequest *RegionDisksResizeRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksDeleteCall struct { + s *Service + project string + region string + disk string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Resize: Resizes the specified regional persistent disk. +// Delete: Deletes the specified regional persistent disk. Deleting a regional +// disk removes all the replicas of its data permanently and is irreversible. +// However, deleting a disk does not delete any snapshots previously made from +// the disk. You must separately delete snapshots. // -// - disk: Name of the regional persistent disk. -// - project: The project ID for this request. +// - disk: Name of the regional persistent disk to delete. +// - project: Project ID for this request. // - region: Name of the region for this request. -func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall { - c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionDisksService) Delete(project string, region string, disk string) *RegionDisksDeleteCall { + c := &RegionDisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.disk = disk - c.regiondisksresizerequest = regiondisksresizerequest return c } @@ -4004,7 +4005,7 @@ func (r *RegionDisksService) Resize(project string, region string, disk string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall { +func (c *RegionDisksDeleteCall) RequestId(requestId string) *RegionDisksDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -4012,38 +4013,34 @@ func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCa // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall { +func (c *RegionDisksDeleteCall) Fields(s ...googleapi.Field) *RegionDisksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall { +func (c *RegionDisksDeleteCall) Context(ctx context.Context) *RegionDisksDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksResizeCall) Header() http.Header { +func (c *RegionDisksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *RegionDisksDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/resize") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -4056,12 +4053,12 @@ func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) { return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.resize" call. +// Do executes the "compute.regionDisks.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4093,85 +4090,90 @@ func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, er return ret, nil } -type RegionDisksSetIamPolicyCall struct { - s *Service - project string - region string - resource string - regionsetpolicyrequest *RegionSetPolicyRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksGetCall struct { + s *Service + project string + region string + disk string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetIamPolicy: Sets the access control policy on the specified resource. -// Replaces any existing policy. +// Get: Returns a specified regional persistent disk. // +// - disk: Name of the regional persistent disk to return. // - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionDisksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionDisksSetIamPolicyCall { - c := &RegionDisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *RegionDisksService) Get(project string, region string, disk string) *RegionDisksGetCall { + c := &RegionDisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.regionsetpolicyrequest = regionsetpolicyrequest + c.disk = disk return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksSetIamPolicyCall { +func (c *RegionDisksGetCall) Fields(s ...googleapi.Field) *RegionDisksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionDisksGetCall) IfNoneMatch(entityTag string) *RegionDisksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *RegionDisksSetIamPolicyCall) Context(ctx context.Context) *RegionDisksSetIamPolicyCall { +func (c *RegionDisksGetCall) Context(ctx context.Context) *RegionDisksGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksSetIamPolicyCall) Header() http.Header { +func (c *RegionDisksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) - if err != nil { - return nil, err +func (c *RegionDisksGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/setIamPolicy") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.setIamPolicy" call. +// Do executes the "compute.regionDisks.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Policy.ServerResponse.Header or (if a response was returned at all) in +// *Disk.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { +func (c *RegionDisksGetCall) Do(opts ...googleapi.CallOption) (*Disk, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4190,7 +4192,7 @@ func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Policy{ + ret := &Disk{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4203,81 +4205,80 @@ func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, return ret, nil } -type RegionDisksSetLabelsCall struct { - s *Service - project string - region string - resource string - regionsetlabelsrequest *RegionSetLabelsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksGetIamPolicyCall struct { + s *Service + project string + region string + resource string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// SetLabels: Sets the labels on the target regional disk. +// GetIamPolicy: Gets the access control policy for a resource. May be empty if +// no such policy or resource exists. // // - project: Project ID for this request. -// - region: The region for this request. +// - region: The name of the region for this request. // - resource: Name or id of the resource for this request. -func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall { - c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionDisksService) GetIamPolicy(project string, region string, resource string) *RegionDisksGetIamPolicyCall { + c := &RegionDisksGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.resource = resource - c.regionsetlabelsrequest = regionsetlabelsrequest return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall { - c.urlParams_.Set("requestId", requestId) +// OptionsRequestedPolicyVersion sets the optional parameter +// "optionsRequestedPolicyVersion": Requested IAM Policy version. +func (c *RegionDisksGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *RegionDisksGetIamPolicyCall { + c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall { +func (c *RegionDisksGetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksGetIamPolicyCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionDisksGetIamPolicyCall) IfNoneMatch(entityTag string) *RegionDisksGetIamPolicyCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall { +func (c *RegionDisksGetIamPolicyCall) Context(ctx context.Context) *RegionDisksGetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksSetLabelsCall) Header() http.Header { +func (c *RegionDisksGetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) - if err != nil { - return nil, err +func (c *RegionDisksGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/setLabels") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/getIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -4290,12 +4291,12 @@ func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.setLabels" call. +// Do executes the "compute.regionDisks.getIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4314,7 +4315,7 @@ func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4327,29 +4328,26 @@ func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, return ret, nil } -type RegionDisksStartAsyncReplicationCall struct { - s *Service - project string - region string - disk string - regiondisksstartasyncreplicationrequest *RegionDisksStartAsyncReplicationRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksInsertCall struct { + s *Service + project string + region string + disk *Disk + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// StartAsyncReplication: Starts asynchronous replication. Must be invoked on -// the primary disk. +// Insert: Creates a persistent regional disk in the specified project using +// the data included in the request. // -// - disk: The name of the persistent disk. // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *RegionDisksService) StartAsyncReplication(project string, region string, disk string, regiondisksstartasyncreplicationrequest *RegionDisksStartAsyncReplicationRequest) *RegionDisksStartAsyncReplicationCall { - c := &RegionDisksStartAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *RegionDisksService) Insert(project string, region string, disk *Disk) *RegionDisksInsertCall { + c := &RegionDisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.disk = disk - c.regiondisksstartasyncreplicationrequest = regiondisksstartasyncreplicationrequest return c } @@ -4363,44 +4361,51 @@ func (r *RegionDisksService) StartAsyncReplication(project string, region string // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksStartAsyncReplicationCall) RequestId(requestId string) *RegionDisksStartAsyncReplicationCall { +func (c *RegionDisksInsertCall) RequestId(requestId string) *RegionDisksInsertCall { c.urlParams_.Set("requestId", requestId) return c } +// SourceImage sets the optional parameter "sourceImage": Source image to +// restore onto a disk. This field is optional. +func (c *RegionDisksInsertCall) SourceImage(sourceImage string) *RegionDisksInsertCall { + c.urlParams_.Set("sourceImage", sourceImage) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksStartAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStartAsyncReplicationCall { +func (c *RegionDisksInsertCall) Fields(s ...googleapi.Field) *RegionDisksInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksStartAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStartAsyncReplicationCall { +func (c *RegionDisksInsertCall) Context(ctx context.Context) *RegionDisksInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksStartAsyncReplicationCall) Header() http.Header { +func (c *RegionDisksInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksstartasyncreplicationrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/startAsyncReplication") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -4410,17 +4415,16 @@ func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Resp googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, - "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.startAsyncReplication" call. +// Do executes the "compute.regionDisks.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksStartAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4452,76 +4456,148 @@ func (c *RegionDisksStartAsyncReplicationCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionDisksStopAsyncReplicationCall struct { - s *Service - project string - region string - disk string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// StopAsyncReplication: Stops asynchronous replication. Can be invoked either -// on the primary or on the secondary disk. +// List: Retrieves the list of persistent disks contained within the specified +// region. // -// - disk: The name of the persistent disk. // - project: Project ID for this request. -// - region: The name of the region for this request. -func (r *RegionDisksService) StopAsyncReplication(project string, region string, disk string) *RegionDisksStopAsyncReplicationCall { - c := &RegionDisksStopAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: Name of the region for this request. +func (r *RegionDisksService) List(project string, region string) *RegionDisksListCall { + c := &RegionDisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disk = disk return c } -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksStopAsyncReplicationCall) RequestId(requestId string) *RegionDisksStopAsyncReplicationCall { - c.urlParams_.Set("requestId", requestId) +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionDisksListCall) Filter(filter string) *RegionDisksListCall { + c.urlParams_.Set("filter", filter) return c } -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionDisksStopAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStopAsyncReplicationCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionDisksListCall) MaxResults(maxResults int64) *RegionDisksListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// Context sets the context to be used in this call's Do method. -func (c *RegionDisksStopAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStopAsyncReplicationCall { - c.ctx_ = ctx +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionDisksListCall) OrderBy(orderBy string) *RegionDisksListCall { + c.urlParams_.Set("orderBy", orderBy) return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionDisksStopAsyncReplicationCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionDisksListCall) PageToken(pageToken string) *RegionDisksListCall { + c.urlParams_.Set("pageToken", pageToken) + return c } -func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication") +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionDisksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionDisksListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionDisksListCall) Fields(s ...googleapi.Field) *RegionDisksListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionDisksListCall) IfNoneMatch(entityTag string) *RegionDisksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionDisksListCall) Context(ctx context.Context) *RegionDisksListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionDisksListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionDisksListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } @@ -4529,17 +4605,16 @@ func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Respo googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, - "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.stopAsyncReplication" call. +// Do executes the "compute.regionDisks.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *DiskList.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksListCall) Do(opts ...googleapi.CallOption) (*DiskList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4558,7 +4633,7 @@ func (c *RegionDisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &DiskList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4571,27 +4646,49 @@ func (c *RegionDisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type RegionDisksStopGroupAsyncReplicationCall struct { - s *Service - project string - region string - disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionDisksListCall) Pages(ctx context.Context, f func(*DiskList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// StopGroupAsyncReplication: Stops asynchronous replication for a consistency -// group of disks. Can be invoked either in the primary or secondary scope. +type RegionDisksRemoveResourcePoliciesCall struct { + s *Service + project string + region string + disk string + regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RemoveResourcePolicies: Removes resource policies from a regional disk. // -// - project: Project ID for this request. -// - region: The name of the region for this request. This must be the region -// of the primary or secondary disks in the consistency group. -func (r *RegionDisksService) StopGroupAsyncReplication(project string, region string, disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource) *RegionDisksStopGroupAsyncReplicationCall { - c := &RegionDisksStopGroupAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - disk: The disk name for this request. +// - project: Project ID for this request. +// - region: The name of the region for this request. +func (r *RegionDisksService) RemoveResourcePolicies(project string, region string, disk string, regiondisksremoveresourcepoliciesrequest *RegionDisksRemoveResourcePoliciesRequest) *RegionDisksRemoveResourcePoliciesCall { + c := &RegionDisksRemoveResourcePoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disksstopgroupasyncreplicationresource = disksstopgroupasyncreplicationresource + c.disk = disk + c.regiondisksremoveresourcepoliciesrequest = regiondisksremoveresourcepoliciesrequest return c } @@ -4605,7 +4702,7 @@ func (r *RegionDisksService) StopGroupAsyncReplication(project string, region st // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksStopGroupAsyncReplicationCall) RequestId(requestId string) *RegionDisksStopGroupAsyncReplicationCall { +func (c *RegionDisksRemoveResourcePoliciesCall) RequestId(requestId string) *RegionDisksRemoveResourcePoliciesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -4613,36 +4710,36 @@ func (c *RegionDisksStopGroupAsyncReplicationCall) RequestId(requestId string) * // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksStopGroupAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStopGroupAsyncReplicationCall { +func (c *RegionDisksRemoveResourcePoliciesCall) Fields(s ...googleapi.Field) *RegionDisksRemoveResourcePoliciesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksStopGroupAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStopGroupAsyncReplicationCall { +func (c *RegionDisksRemoveResourcePoliciesCall) Context(ctx context.Context) *RegionDisksRemoveResourcePoliciesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksStopGroupAsyncReplicationCall) Header() http.Header { +func (c *RegionDisksRemoveResourcePoliciesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksRemoveResourcePoliciesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksremoveresourcepoliciesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/stopGroupAsyncReplication") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/removeResourcePolicies") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -4652,16 +4749,17 @@ func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http. googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.stopGroupAsyncReplication" call. +// Do executes the "compute.regionDisks.removeResourcePolicies" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksStopGroupAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksRemoveResourcePoliciesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4693,65 +4791,79 @@ func (c *RegionDisksStopGroupAsyncReplicationCall) Do(opts ...googleapi.CallOpti return ret, nil } -type RegionDisksTestIamPermissionsCall struct { - s *Service - project string - region string - resource string - testpermissionsrequest *TestPermissionsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksResizeCall struct { + s *Service + project string + region string + disk string + regiondisksresizerequest *RegionDisksResizeRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// TestIamPermissions: Returns permissions that a caller has on the specified -// resource. +// Resize: Resizes the specified regional persistent disk. // -// - project: Project ID for this request. -// - region: The name of the region for this request. -// - resource: Name or id of the resource for this request. -func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall { - c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - disk: Name of the regional persistent disk. +// - project: The project ID for this request. +// - region: Name of the region for this request. +func (r *RegionDisksService) Resize(project string, region string, disk string, regiondisksresizerequest *RegionDisksResizeRequest) *RegionDisksResizeCall { + c := &RegionDisksResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.resource = resource - c.testpermissionsrequest = testpermissionsrequest + c.disk = disk + c.regiondisksresizerequest = regiondisksresizerequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionDisksResizeCall) RequestId(requestId string) *RegionDisksResizeCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall { +func (c *RegionDisksResizeCall) Fields(s ...googleapi.Field) *RegionDisksResizeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall { +func (c *RegionDisksResizeCall) Context(ctx context.Context) *RegionDisksResizeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksTestIamPermissionsCall) Header() http.Header { +func (c *RegionDisksResizeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksresizerequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/testIamPermissions") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/resize") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -4759,20 +4871,19 @@ func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Respons } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "resource": c.resource, + "project": c.project, + "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.testIamPermissions" call. +// Do executes the "compute.regionDisks.resize" call. // Any non-2xx status code is an error. Response headers are in either -// *TestPermissionsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionDisksResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4791,7 +4902,7 @@ func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*T if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &TestPermissionsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4804,114 +4915,85 @@ func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*T return ret, nil } -type RegionDisksUpdateCall struct { - s *Service - project string - region string - disk string - disk2 *Disk - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksSetIamPolicyCall struct { + s *Service + project string + region string + resource string + regionsetpolicyrequest *RegionSetPolicyRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Update: Update the specified disk with the data included in the request. -// Update is performed only on selected fields included as part of update-mask. -// Only the following fields can be modified: user_license. +// SetIamPolicy: Sets the access control policy on the specified resource. +// Replaces any existing policy. // -// - disk: The disk name for this request. // - project: Project ID for this request. // - region: The name of the region for this request. -func (r *RegionDisksService) Update(project string, region string, disk string, disk2 *Disk) *RegionDisksUpdateCall { - c := &RegionDisksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - resource: Name or id of the resource for this request. +func (r *RegionDisksService) SetIamPolicy(project string, region string, resource string, regionsetpolicyrequest *RegionSetPolicyRequest) *RegionDisksSetIamPolicyCall { + c := &RegionDisksSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.disk = disk - c.disk2 = disk2 + c.resource = resource + c.regionsetpolicyrequest = regionsetpolicyrequest return c } -// Paths sets the optional parameter "paths": -func (c *RegionDisksUpdateCall) Paths(paths ...string) *RegionDisksUpdateCall { - c.urlParams_.SetMulti("paths", append([]string{}, paths...)) - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionDisksUpdateCall) RequestId(requestId string) *RegionDisksUpdateCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// UpdateMask sets the optional parameter "updateMask": update_mask indicates -// fields to be updated as part of this request. -func (c *RegionDisksUpdateCall) UpdateMask(updateMask string) *RegionDisksUpdateCall { - c.urlParams_.Set("updateMask", updateMask) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionDisksUpdateCall) Fields(s ...googleapi.Field) *RegionDisksUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionDisksSetIamPolicyCall) Fields(s ...googleapi.Field) *RegionDisksSetIamPolicyCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionDisksUpdateCall) Context(ctx context.Context) *RegionDisksUpdateCall { +func (c *RegionDisksSetIamPolicyCall) Context(ctx context.Context) *RegionDisksSetIamPolicyCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionDisksUpdateCall) Header() http.Header { +func (c *RegionDisksSetIamPolicyCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionDisksUpdateCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetpolicyrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/setIamPolicy") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "disk": c.disk, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionDisks.update" call. +// Do executes the "compute.regionDisks.setIamPolicy" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *Policy.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionDisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -4930,7 +5012,7 @@ func (c *RegionDisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, er if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &Policy{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -4943,27 +5025,28 @@ func (c *RegionDisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, er return ret, nil } -type RegionHealthCheckServicesDeleteCall struct { - s *Service - project string - region string - healthCheckService string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksSetLabelsCall struct { + s *Service + project string + region string + resource string + regionsetlabelsrequest *RegionSetLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified regional HealthCheckService. +// SetLabels: Sets the labels on the target regional disk. // -// - healthCheckService: Name of the HealthCheckService to delete. The name -// must be 1-63 characters long, and comply with RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthCheckServicesService) Delete(project string, region string, healthCheckService string) *RegionHealthCheckServicesDeleteCall { - c := &RegionHealthCheckServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: The region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionDisksService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionDisksSetLabelsCall { + c := &RegionDisksSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthCheckService = healthCheckService + c.resource = resource + c.regionsetlabelsrequest = regionsetlabelsrequest return c } @@ -4977,7 +5060,7 @@ func (r *RegionHealthCheckServicesService) Delete(project string, region string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthCheckServicesDeleteCall) RequestId(requestId string) *RegionHealthCheckServicesDeleteCall { +func (c *RegionDisksSetLabelsCall) RequestId(requestId string) *RegionDisksSetLabelsCall { c.urlParams_.Set("requestId", requestId) return c } @@ -4985,52 +5068,56 @@ func (c *RegionHealthCheckServicesDeleteCall) RequestId(requestId string) *Regio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthCheckServicesDeleteCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesDeleteCall { +func (c *RegionDisksSetLabelsCall) Fields(s ...googleapi.Field) *RegionDisksSetLabelsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthCheckServicesDeleteCall) Context(ctx context.Context) *RegionHealthCheckServicesDeleteCall { +func (c *RegionDisksSetLabelsCall) Context(ctx context.Context) *RegionDisksSetLabelsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header { +func (c *RegionDisksSetLabelsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *RegionDisksSetLabelsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/setLabels") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "healthCheckService": c.healthCheckService, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthCheckServices.delete" call. +// Do executes the "compute.regionDisks.setLabels" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthCheckServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5062,92 +5149,100 @@ func (c *RegionHealthCheckServicesDeleteCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type RegionHealthCheckServicesGetCall struct { - s *Service - project string - region string - healthCheckService string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionDisksStartAsyncReplicationCall struct { + s *Service + project string + region string + disk string + regiondisksstartasyncreplicationrequest *RegionDisksStartAsyncReplicationRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified regional HealthCheckService resource. +// StartAsyncReplication: Starts asynchronous replication. Must be invoked on +// the primary disk. // -// - healthCheckService: Name of the HealthCheckService to update. The name -// must be 1-63 characters long, and comply with RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthCheckServicesService) Get(project string, region string, healthCheckService string) *RegionHealthCheckServicesGetCall { - c := &RegionHealthCheckServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - disk: The name of the persistent disk. +// - project: Project ID for this request. +// - region: The name of the region for this request. +func (r *RegionDisksService) StartAsyncReplication(project string, region string, disk string, regiondisksstartasyncreplicationrequest *RegionDisksStartAsyncReplicationRequest) *RegionDisksStartAsyncReplicationCall { + c := &RegionDisksStartAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthCheckService = healthCheckService + c.disk = disk + c.regiondisksstartasyncreplicationrequest = regiondisksstartasyncreplicationrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionDisksStartAsyncReplicationCall) RequestId(requestId string) *RegionDisksStartAsyncReplicationCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthCheckServicesGetCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesGetCall { +func (c *RegionDisksStartAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStartAsyncReplicationCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionHealthCheckServicesGetCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionHealthCheckServicesGetCall) Context(ctx context.Context) *RegionHealthCheckServicesGetCall { +func (c *RegionDisksStartAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStartAsyncReplicationCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthCheckServicesGetCall) Header() http.Header { +func (c *RegionDisksStartAsyncReplicationCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionDisksStartAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regiondisksstartasyncreplicationrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/startAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "healthCheckService": c.healthCheckService, + "project": c.project, + "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthCheckServices.get" call. +// Do executes the "compute.regionDisks.startAsyncReplication" call. // Any non-2xx status code is an error. Response headers are in either -// *HealthCheckService.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*HealthCheckService, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionDisksStartAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5166,7 +5261,7 @@ func (c *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*He if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &HealthCheckService{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5179,26 +5274,27 @@ func (c *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*He return ret, nil } -type RegionHealthCheckServicesInsertCall struct { - s *Service - project string - region string - healthcheckservice *HealthCheckService - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksStopAsyncReplicationCall struct { + s *Service + project string + region string + disk string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a regional HealthCheckService resource in the specified -// project and region using the data included in the request. +// StopAsyncReplication: Stops asynchronous replication. Can be invoked either +// on the primary or on the secondary disk. // +// - disk: The name of the persistent disk. // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthCheckServicesService) Insert(project string, region string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesInsertCall { - c := &RegionHealthCheckServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *RegionDisksService) StopAsyncReplication(project string, region string, disk string) *RegionDisksStopAsyncReplicationCall { + c := &RegionDisksStopAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthcheckservice = healthcheckservice + c.disk = disk return c } @@ -5212,7 +5308,7 @@ func (r *RegionHealthCheckServicesService) Insert(project string, region string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthCheckServicesInsertCall) RequestId(requestId string) *RegionHealthCheckServicesInsertCall { +func (c *RegionDisksStopAsyncReplicationCall) RequestId(requestId string) *RegionDisksStopAsyncReplicationCall { c.urlParams_.Set("requestId", requestId) return c } @@ -5220,36 +5316,32 @@ func (c *RegionHealthCheckServicesInsertCall) RequestId(requestId string) *Regio // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthCheckServicesInsertCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesInsertCall { +func (c *RegionDisksStopAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStopAsyncReplicationCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthCheckServicesInsertCall) Context(ctx context.Context) *RegionHealthCheckServicesInsertCall { +func (c *RegionDisksStopAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStopAsyncReplicationCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthCheckServicesInsertCall) Header() http.Header { +func (c *RegionDisksStopAsyncReplicationCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *RegionDisksStopAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}/stopAsyncReplication") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -5259,16 +5351,17 @@ func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Respo googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthCheckServices.insert" call. +// Do executes the "compute.regionDisks.stopAsyncReplication" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthCheckServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksStopAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5300,148 +5393,80 @@ func (c *RegionHealthCheckServicesInsertCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -type RegionHealthCheckServicesListCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionDisksStopGroupAsyncReplicationCall struct { + s *Service + project string + region string + disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Lists all the HealthCheckService resources that have been configured -// for the specified project in the given region. +// StopGroupAsyncReplication: Stops asynchronous replication for a consistency +// group of disks. Can be invoked either in the primary or secondary scope. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthCheckServicesService) List(project string, region string) *RegionHealthCheckServicesListCall { - c := &RegionHealthCheckServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: The name of the region for this request. This must be the region +// of the primary or secondary disks in the consistency group. +func (r *RegionDisksService) StopGroupAsyncReplication(project string, region string, disksstopgroupasyncreplicationresource *DisksStopGroupAsyncReplicationResource) *RegionDisksStopGroupAsyncReplicationCall { + c := &RegionDisksStopGroupAsyncReplicationCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region + c.disksstopgroupasyncreplicationresource = disksstopgroupasyncreplicationresource return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionHealthCheckServicesListCall) Filter(filter string) *RegionHealthCheckServicesListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionHealthCheckServicesListCall) MaxResults(maxResults int64) *RegionHealthCheckServicesListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionHealthCheckServicesListCall) OrderBy(orderBy string) *RegionHealthCheckServicesListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionHealthCheckServicesListCall) PageToken(pageToken string) *RegionHealthCheckServicesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionHealthCheckServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionHealthCheckServicesListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionDisksStopGroupAsyncReplicationCall) RequestId(requestId string) *RegionDisksStopGroupAsyncReplicationCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthCheckServicesListCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesListCall { +func (c *RegionDisksStopGroupAsyncReplicationCall) Fields(s ...googleapi.Field) *RegionDisksStopGroupAsyncReplicationCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionHealthCheckServicesListCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionHealthCheckServicesListCall) Context(ctx context.Context) *RegionHealthCheckServicesListCall { +func (c *RegionDisksStopGroupAsyncReplicationCall) Context(ctx context.Context) *RegionDisksStopGroupAsyncReplicationCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthCheckServicesListCall) Header() http.Header { +func (c *RegionDisksStopGroupAsyncReplicationCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionDisksStopGroupAsyncReplicationCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disksstopgroupasyncreplicationresource) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/stopGroupAsyncReplication") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -5453,13 +5478,12 @@ func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Respons return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthCheckServices.list" call. +// Do executes the "compute.regionDisks.stopGroupAsyncReplication" call. // Any non-2xx status code is an error. Response headers are in either -// *HealthCheckServicesList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*HealthCheckServicesList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionDisksStopGroupAsyncReplicationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5478,7 +5502,7 @@ func (c *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*H if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &HealthCheckServicesList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5491,123 +5515,86 @@ func (c *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*H return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionHealthCheckServicesListCall) Pages(ctx context.Context, f func(*HealthCheckServicesList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionHealthCheckServicesPatchCall struct { - s *Service - project string - region string - healthCheckService string - healthcheckservice *HealthCheckService - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksTestIamPermissionsCall struct { + s *Service + project string + region string + resource string + testpermissionsrequest *TestPermissionsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates the specified regional HealthCheckService resource with the -// data included in the request. This method supports PATCH semantics and uses -// the JSON merge patch format and processing rules. +// TestIamPermissions: Returns permissions that a caller has on the specified +// resource. // -// - healthCheckService: Name of the HealthCheckService to update. The name -// must be 1-63 characters long, and comply with RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthCheckServicesService) Patch(project string, region string, healthCheckService string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesPatchCall { - c := &RegionHealthCheckServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: The name of the region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionDisksService) TestIamPermissions(project string, region string, resource string, testpermissionsrequest *TestPermissionsRequest) *RegionDisksTestIamPermissionsCall { + c := &RegionDisksTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthCheckService = healthCheckService - c.healthcheckservice = healthcheckservice - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthCheckServicesPatchCall) RequestId(requestId string) *RegionHealthCheckServicesPatchCall { - c.urlParams_.Set("requestId", requestId) + c.resource = resource + c.testpermissionsrequest = testpermissionsrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthCheckServicesPatchCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesPatchCall { +func (c *RegionDisksTestIamPermissionsCall) Fields(s ...googleapi.Field) *RegionDisksTestIamPermissionsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthCheckServicesPatchCall) Context(ctx context.Context) *RegionHealthCheckServicesPatchCall { +func (c *RegionDisksTestIamPermissionsCall) Context(ctx context.Context) *RegionDisksTestIamPermissionsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthCheckServicesPatchCall) Header() http.Header { +func (c *RegionDisksTestIamPermissionsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthCheckServicesPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionDisksTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{resource}/testIamPermissions") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "healthCheckService": c.healthCheckService, + "project": c.project, + "region": c.region, + "resource": c.resource, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthCheckServices.patch" call. +// Do executes the "compute.regionDisks.testIamPermissions" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthCheckServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *TestPermissionsResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionDisksTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5626,7 +5613,7 @@ func (c *RegionHealthCheckServicesPatchCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &TestPermissionsResponse{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5639,26 +5626,36 @@ func (c *RegionHealthCheckServicesPatchCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type RegionHealthChecksDeleteCall struct { - s *Service - project string - region string - healthCheck string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionDisksUpdateCall struct { + s *Service + project string + region string + disk string + disk2 *Disk + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Delete: Deletes the specified HealthCheck resource. +// Update: Update the specified disk with the data included in the request. +// Update is performed only on selected fields included as part of update-mask. +// Only the following fields can be modified: user_license. // -// - healthCheck: Name of the HealthCheck resource to delete. +// - disk: The disk name for this request. // - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall { - c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - region: The name of the region for this request. +func (r *RegionDisksService) Update(project string, region string, disk string, disk2 *Disk) *RegionDisksUpdateCall { + c := &RegionDisksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthCheck = healthCheck + c.disk = disk + c.disk2 = disk2 + return c +} + +// Paths sets the optional parameter "paths": +func (c *RegionDisksUpdateCall) Paths(paths ...string) *RegionDisksUpdateCall { + c.urlParams_.SetMulti("paths", append([]string{}, paths...)) return c } @@ -5672,60 +5669,71 @@ func (r *RegionHealthChecksService) Delete(project string, region string, health // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall { +func (c *RegionDisksUpdateCall) RequestId(requestId string) *RegionDisksUpdateCall { c.urlParams_.Set("requestId", requestId) return c } +// UpdateMask sets the optional parameter "updateMask": update_mask indicates +// fields to be updated as part of this request. +func (c *RegionDisksUpdateCall) UpdateMask(updateMask string) *RegionDisksUpdateCall { + c.urlParams_.Set("updateMask", updateMask) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall { +func (c *RegionDisksUpdateCall) Fields(s ...googleapi.Field) *RegionDisksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall { +func (c *RegionDisksUpdateCall) Context(ctx context.Context) *RegionDisksUpdateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthChecksDeleteCall) Header() http.Header { +func (c *RegionDisksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *RegionDisksUpdateCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk2) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/disks/{disk}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "healthCheck": c.healthCheck, + "project": c.project, + "region": c.region, + "disk": c.disk, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthChecks.delete" call. +// Do executes the "compute.regionDisks.update" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionDisksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5757,90 +5765,94 @@ func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operat return ret, nil } -type RegionHealthChecksGetCall struct { - s *Service - project string - region string - healthCheck string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionHealthCheckServicesDeleteCall struct { + s *Service + project string + region string + healthCheckService string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns the specified HealthCheck resource. +// Delete: Deletes the specified regional HealthCheckService. // -// - healthCheck: Name of the HealthCheck resource to return. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall { - c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - healthCheckService: Name of the HealthCheckService to delete. The name +// must be 1-63 characters long, and comply with RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionHealthCheckServicesService) Delete(project string, region string, healthCheckService string) *RegionHealthCheckServicesDeleteCall { + c := &RegionHealthCheckServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthCheck = healthCheck + c.healthCheckService = healthCheckService + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionHealthCheckServicesDeleteCall) RequestId(requestId string) *RegionHealthCheckServicesDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall { +func (c *RegionHealthCheckServicesDeleteCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall { +func (c *RegionHealthCheckServicesDeleteCall) Context(ctx context.Context) *RegionHealthCheckServicesDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthChecksGetCall) Header() http.Header { +func (c *RegionHealthCheckServicesDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionHealthCheckServicesDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "healthCheck": c.healthCheck, + "project": c.project, + "region": c.region, + "healthCheckService": c.healthCheckService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthChecks.get" call. +// Do executes the "compute.regionHealthCheckServices.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *HealthCheck.ServerResponse.Header or (if a response was returned at all) in +// *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) { +func (c *RegionHealthCheckServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5859,7 +5871,7 @@ func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthChe if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &HealthCheck{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -5872,77 +5884,194 @@ func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthChe return ret, nil } -type RegionHealthChecksInsertCall struct { - s *Service - project string - region string - healthcheck *HealthCheck - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionHealthCheckServicesGetCall struct { + s *Service + project string + region string + healthCheckService string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// Insert: Creates a HealthCheck resource in the specified project using the -// data included in the request. +// Get: Returns the specified regional HealthCheckService resource. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall { - c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - healthCheckService: Name of the HealthCheckService to update. The name +// must be 1-63 characters long, and comply with RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionHealthCheckServicesService) Get(project string, region string, healthCheckService string) *RegionHealthCheckServicesGetCall { + c := &RegionHealthCheckServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthcheck = healthcheck - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall { - c.urlParams_.Set("requestId", requestId) + c.healthCheckService = healthCheckService return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall { +func (c *RegionHealthCheckServicesGetCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionHealthCheckServicesGetCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall { +func (c *RegionHealthCheckServicesGetCall) Context(ctx context.Context) *RegionHealthCheckServicesGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthChecksInsertCall) Header() http.Header { +func (c *RegionHealthCheckServicesGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) - if err != nil { - return nil, err +func (c *RegionHealthCheckServicesGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "healthCheckService": c.healthCheckService, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionHealthCheckServices.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *HealthCheckService.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionHealthCheckServicesGetCall) Do(opts ...googleapi.CallOption) (*HealthCheckService, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &HealthCheckService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type RegionHealthCheckServicesInsertCall struct { + s *Service + project string + region string + healthcheckservice *HealthCheckService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Insert: Creates a regional HealthCheckService resource in the specified +// project and region using the data included in the request. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionHealthCheckServicesService) Insert(project string, region string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesInsertCall { + c := &RegionHealthCheckServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.healthcheckservice = healthcheckservice + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionHealthCheckServicesInsertCall) RequestId(requestId string) *RegionHealthCheckServicesInsertCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionHealthCheckServicesInsertCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionHealthCheckServicesInsertCall) Context(ctx context.Context) *RegionHealthCheckServicesInsertCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionHealthCheckServicesInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionHealthCheckServicesInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -5956,12 +6085,12 @@ func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthChecks.insert" call. +// Do executes the "compute.regionHealthCheckServices.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthCheckServicesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -5993,7 +6122,7 @@ func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operat return ret, nil } -type RegionHealthChecksListCall struct { +type RegionHealthCheckServicesListCall struct { s *Service project string region string @@ -6003,13 +6132,13 @@ type RegionHealthChecksListCall struct { header_ http.Header } -// List: Retrieves the list of HealthCheck resources available to the specified -// project. +// List: Lists all the HealthCheckService resources that have been configured +// for the specified project in the given region. // // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall { - c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionHealthCheckServicesService) List(project string, region string) *RegionHealthCheckServicesListCall { + c := &RegionHealthCheckServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c @@ -6047,7 +6176,7 @@ func (r *RegionHealthChecksService) List(project string, region string) *RegionH // filter for instances that do not end with name "instance", you would use // `name ne .*instance`. You cannot combine constraints on multiple fields // using regular expressions. -func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) Filter(filter string) *RegionHealthCheckServicesListCall { c.urlParams_.Set("filter", filter) return c } @@ -6057,7 +6186,7 @@ func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksLi // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that // can be used to get the next page of results in subsequent list requests. // Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) MaxResults(maxResults int64) *RegionHealthCheckServicesListCall { c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } @@ -6070,7 +6199,7 @@ func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthC // chronological order (newest result first). Use this to sort resources like // operations so that the newest operation is returned first. Currently, only // sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) OrderBy(orderBy string) *RegionHealthCheckServicesListCall { c.urlParams_.Set("orderBy", orderBy) return c } @@ -6078,7 +6207,7 @@ func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecks // PageToken sets the optional parameter "pageToken": Specifies a page token to // use. Set `pageToken` to the `nextPageToken` returned by a previous list // request to get the next page of results. -func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) PageToken(pageToken string) *RegionHealthCheckServicesListCall { c.urlParams_.Set("pageToken", pageToken) return c } @@ -6088,7 +6217,7 @@ func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthCh // of failure. The default value is false. For example, when partial success // behavior is enabled, aggregatedList for a single zone scope either returns // all resources in the zone or no resources, with an error code. -func (c *RegionHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionHealthCheckServicesListCall { c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) return c } @@ -6096,7 +6225,7 @@ func (c *RegionHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess b // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesListCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } @@ -6104,27 +6233,27 @@ func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthC // IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. -func (c *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) IfNoneMatch(entityTag string) *RegionHealthCheckServicesListCall { c.ifNoneMatch_ = entityTag return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall { +func (c *RegionHealthCheckServicesListCall) Context(ctx context.Context) *RegionHealthCheckServicesListCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthChecksListCall) Header() http.Header { +func (c *RegionHealthCheckServicesListCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionHealthCheckServicesListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) @@ -6132,7 +6261,7 @@ func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, erro var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("GET", urls, body) if err != nil { @@ -6146,13 +6275,13 @@ func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, erro return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthChecks.list" call. +// Do executes the "compute.regionHealthCheckServices.list" call. // Any non-2xx status code is an error. Response headers are in either -// *HealthCheckList.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) { +// *HealthCheckServicesList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionHealthCheckServicesListCall) Do(opts ...googleapi.CallOption) (*HealthCheckServicesList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6171,7 +6300,7 @@ func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCh if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &HealthCheckList{ + ret := &HealthCheckServicesList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6187,7 +6316,7 @@ func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCh // Pages invokes f for each page of results. // A non-nil error returned from f will halt the iteration. // The provided context supersedes any context provided to the Context method. -func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error { +func (c *RegionHealthCheckServicesListCall) Pages(ctx context.Context, f func(*HealthCheckServicesList) error) error { c.ctx_ = ctx defer c.PageToken(c.urlParams_.Get("pageToken")) for { @@ -6205,30 +6334,31 @@ func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCh } } -type RegionHealthChecksPatchCall struct { - s *Service - project string - region string - healthCheck string - healthcheck *HealthCheck - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionHealthCheckServicesPatchCall struct { + s *Service + project string + region string + healthCheckService string + healthcheckservice *HealthCheckService + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a HealthCheck resource in the specified project using the +// Patch: Updates the specified regional HealthCheckService resource with the // data included in the request. This method supports PATCH semantics and uses // the JSON merge patch format and processing rules. // -// - healthCheck: Name of the HealthCheck resource to patch. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall { - c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - healthCheckService: Name of the HealthCheckService to update. The name +// must be 1-63 characters long, and comply with RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionHealthCheckServicesService) Patch(project string, region string, healthCheckService string, healthcheckservice *HealthCheckService) *RegionHealthCheckServicesPatchCall { + c := &RegionHealthCheckServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.healthCheck = healthCheck - c.healthcheck = healthcheck + c.healthCheckService = healthCheckService + c.healthcheckservice = healthcheckservice return c } @@ -6242,7 +6372,7 @@ func (r *RegionHealthChecksService) Patch(project string, region string, healthC // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall { +func (c *RegionHealthCheckServicesPatchCall) RequestId(requestId string) *RegionHealthCheckServicesPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -6250,36 +6380,36 @@ func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthC // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall { +func (c *RegionHealthCheckServicesPatchCall) Fields(s ...googleapi.Field) *RegionHealthCheckServicesPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall { +func (c *RegionHealthCheckServicesPatchCall) Context(ctx context.Context) *RegionHealthCheckServicesPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthChecksPatchCall) Header() http.Header { +func (c *RegionHealthCheckServicesPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionHealthCheckServicesPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheckservice) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthCheckServices/{healthCheckService}") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("PATCH", urls, body) if err != nil { @@ -6287,19 +6417,19 @@ func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "healthCheck": c.healthCheck, + "project": c.project, + "region": c.region, + "healthCheckService": c.healthCheckService, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthChecks.patch" call. +// Do executes the "compute.regionHealthCheckServices.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthCheckServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6331,29 +6461,26 @@ func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operati return ret, nil } -type RegionHealthChecksUpdateCall struct { +type RegionHealthChecksDeleteCall struct { s *Service project string region string healthCheck string - healthcheck *HealthCheck urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// Update: Updates a HealthCheck resource in the specified project using the -// data included in the request. +// Delete: Deletes the specified HealthCheck resource. // -// - healthCheck: Name of the HealthCheck resource to update. +// - healthCheck: Name of the HealthCheck resource to delete. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall { - c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionHealthChecksService) Delete(project string, region string, healthCheck string) *RegionHealthChecksDeleteCall { + c := &RegionHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.healthCheck = healthCheck - c.healthcheck = healthcheck return c } @@ -6367,7 +6494,7 @@ func (r *RegionHealthChecksService) Update(project string, region string, health // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall { +func (c *RegionHealthChecksDeleteCall) RequestId(requestId string) *RegionHealthChecksDeleteCall { c.urlParams_.Set("requestId", requestId) return c } @@ -6375,38 +6502,34 @@ func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealth // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall { +func (c *RegionHealthChecksDeleteCall) Fields(s ...googleapi.Field) *RegionHealthChecksDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall { +func (c *RegionHealthChecksDeleteCall) Context(ctx context.Context) *RegionHealthChecksDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionHealthChecksUpdateCall) Header() http.Header { +func (c *RegionHealthChecksDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) +func (c *RegionHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) - if err != nil { - return nil, err - } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PUT", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } @@ -6419,12 +6542,12 @@ func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, er return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionHealthChecks.update" call. +// Do executes the "compute.regionHealthChecks.delete" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthChecksDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6456,110 +6579,90 @@ func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operat return ret, nil } -type RegionInstanceGroupManagersAbandonInstancesCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionHealthChecksGetCall struct { + s *Service + project string + region string + healthCheck string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// AbandonInstances: Flags the specified instances to be immediately removed -// from the managed instance group. Abandoning an instance does not delete the -// instance, but it does remove the instance from any target pools that are -// applied by the managed instance group. This method reduces the targetSize of -// the managed instance group by the number of instances that you abandon. This -// operation is marked as DONE when the action is scheduled even if the -// instances have not yet been removed from the group. You must separately -// verify the status of the abandoning action with the listmanagedinstances -// method. If the group is part of a backend service that has enabled -// connection draining, it can take up to 60 seconds after the connection -// draining duration has elapsed before the VM instance is removed or deleted. -// You can specify a maximum of 1000 instances with this method per request. +// Get: Returns the specified HealthCheck resource. // -// - instanceGroupManager: Name of the managed instance group. +// - healthCheck: Name of the HealthCheck resource to return. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall { - c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionHealthChecksService) Get(project string, region string, healthCheck string) *RegionHealthChecksGetCall { + c := &RegionHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall { - c.urlParams_.Set("requestId", requestId) + c.healthCheck = healthCheck return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall { +func (c *RegionHealthChecksGetCall) Fields(s ...googleapi.Field) *RegionHealthChecksGetCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionHealthChecksGetCall) IfNoneMatch(entityTag string) *RegionHealthChecksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall { +func (c *RegionHealthChecksGetCall) Context(ctx context.Context) *RegionHealthChecksGetCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header { +func (c *RegionHealthChecksGetCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest) - if err != nil { - return nil, err +func (c *RegionHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "instanceGroupManager": c.instanceGroupManager, + "project": c.project, + "region": c.region, + "healthCheck": c.healthCheck, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call. +// Do executes the "compute.regionHealthChecks.get" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in +// *HealthCheck.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthChecksGetCall) Do(opts ...googleapi.CallOption) (*HealthCheck, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6578,7 +6681,7 @@ func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.C if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &HealthCheck{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6591,67 +6694,77 @@ func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.C return ret, nil } -type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionHealthChecksInsertCall struct { + s *Service + project string + region string + healthcheck *HealthCheck + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ApplyUpdatesToInstances: Apply updates to selected instances the managed -// instance group. +// Insert: Creates a HealthCheck resource in the specified project using the +// data included in the request. // -// - instanceGroupManager: The name of the managed instance group, should -// conform to RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request, should conform to -// RFC1035. -func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall { - c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionHealthChecksService) Insert(project string, region string, healthcheck *HealthCheck) *RegionHealthChecksInsertCall { + c := &RegionHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest + c.healthcheck = healthcheck + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionHealthChecksInsertCall) RequestId(requestId string) *RegionHealthChecksInsertCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall { +func (c *RegionHealthChecksInsertCall) Fields(s ...googleapi.Field) *RegionHealthChecksInsertCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall { +func (c *RegionHealthChecksInsertCall) Context(ctx context.Context) *RegionHealthChecksInsertCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header { +func (c *RegionHealthChecksInsertCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -6659,19 +6772,18 @@ func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt s } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "instanceGroupManager": c.instanceGroupManager, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call. +// Do executes the "compute.regionHealthChecks.insert" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthChecksInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6703,105 +6815,166 @@ func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...goog return ret, nil } -type RegionInstanceGroupManagersCreateInstancesCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionHealthChecksListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header } -// CreateInstances: Creates instances with per-instance configurations in this -// regional managed instance group. Instances are created using the current -// instance template. The create instances operation is marked DONE if the -// createInstances request is successful. The underlying actions take -// additional time. You must separately verify the status of the creating or -// actions with the listmanagedinstances method. +// List: Retrieves the list of HealthCheck resources available to the specified +// project. // -// - instanceGroupManager: The name of the managed instance group. It should -// conform to RFC1035. -// - project: Project ID for this request. -// - region: The name of the region where the managed instance group is -// located. It should conform to RFC1035. -func (r *RegionInstanceGroupManagersService) CreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest) *RegionInstanceGroupManagersCreateInstancesCall { - c := &RegionInstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionHealthChecksService) List(project string, region string) *RegionHealthChecksListCall { + c := &RegionHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagerscreateinstancesrequest = regioninstancegroupmanagerscreateinstancesrequest - return c -} - -// RequestId sets the optional parameter "requestId": An optional request ID to -// identify requests. Specify a unique request ID so that if you must retry -// your request, the server will know to ignore the request if it has already -// been completed. For example, consider a situation where you make an initial -// request and the request times out. If you make the request again with the -// same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. The -// request ID must be a valid UUID with the exception that zero UUID is not -// supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersCreateInstancesCall { - c.urlParams_.Set("requestId", requestId) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *RegionInstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersCreateInstancesCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersCreateInstancesCall { - c.ctx_ = ctx return c } -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionHealthChecksListCall) Filter(filter string) *RegionHealthChecksListCall { + c.urlParams_.Set("filter", filter) + return c +} -func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest) - if err != nil { - return nil, err +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionHealthChecksListCall) MaxResults(maxResults int64) *RegionHealthChecksListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionHealthChecksListCall) OrderBy(orderBy string) *RegionHealthChecksListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionHealthChecksListCall) PageToken(pageToken string) *RegionHealthChecksListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionHealthChecksListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionHealthChecksListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionHealthChecksListCall) Fields(s ...googleapi.Field) *RegionHealthChecksListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionHealthChecksListCall) IfNoneMatch(entityTag string) *RegionHealthChecksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionHealthChecksListCall) Context(ctx context.Context) *RegionHealthChecksListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionHealthChecksListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionHealthChecksListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } + var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("GET", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "instanceGroupManager": c.instanceGroupManager, + "project": c.project, + "region": c.region, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.createInstances" call. +// Do executes the "compute.regionHealthChecks.list" call. // Any non-2xx status code is an error. Response headers are in either -// *Operation.ServerResponse.Header or (if a response was returned at all) in -// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check -// whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +// *HealthCheckList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionHealthChecksListCall) Do(opts ...googleapi.CallOption) (*HealthCheckList, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6820,7 +6993,7 @@ func (c *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.Ca if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &Operation{ + ret := &HealthCheckList{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -6833,27 +7006,51 @@ func (c *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.Ca return ret, nil } -type RegionInstanceGroupManagersDeleteCall struct { - s *Service - project string - region string - instanceGroupManager string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionHealthChecksListCall) Pages(ctx context.Context, f func(*HealthCheckList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } } -// Delete: Deletes the specified managed instance group and all of the -// instances in that group. +type RegionHealthChecksPatchCall struct { + s *Service + project string + region string + healthCheck string + healthcheck *HealthCheck + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a HealthCheck resource in the specified project using the +// data included in the request. This method supports PATCH semantics and uses +// the JSON merge patch format and processing rules. // -// - instanceGroupManager: Name of the managed instance group to delete. +// - healthCheck: Name of the HealthCheck resource to patch. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall { - c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionHealthChecksService) Patch(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksPatchCall { + c := &RegionHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instanceGroupManager = instanceGroupManager + c.healthCheck = healthCheck + c.healthcheck = healthcheck return c } @@ -6867,7 +7064,7 @@ func (r *RegionInstanceGroupManagersService) Delete(project string, region strin // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall { +func (c *RegionHealthChecksPatchCall) RequestId(requestId string) *RegionHealthChecksPatchCall { c.urlParams_.Set("requestId", requestId) return c } @@ -6875,52 +7072,56 @@ func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *Reg // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall { +func (c *RegionHealthChecksPatchCall) Fields(s ...googleapi.Field) *RegionHealthChecksPatchCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall { +func (c *RegionHealthChecksPatchCall) Context(ctx context.Context) *RegionHealthChecksPatchCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header { +func (c *RegionHealthChecksPatchCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *RegionHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("DELETE", urls, body) + req, err := http.NewRequest("PATCH", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "instanceGroupManager": c.instanceGroupManager, + "project": c.project, + "region": c.region, + "healthCheck": c.healthCheck, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.delete" call. +// Do executes the "compute.regionHealthChecks.patch" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthChecksPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -6952,38 +7153,29 @@ func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionInstanceGroupManagersDeleteInstancesCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionHealthChecksUpdateCall struct { + s *Service + project string + region string + healthCheck string + healthcheck *HealthCheck + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// DeleteInstances: Flags the specified instances in the managed instance group -// to be immediately deleted. The instances are also removed from any target -// pools of which they were a member. This method reduces the targetSize of the -// managed instance group by the number of instances that you delete. The -// deleteInstances operation is marked DONE if the deleteInstances request is -// successful. The underlying actions take additional time. You must separately -// verify the status of the deleting action with the listmanagedinstances -// method. If the group is part of a backend service that has enabled -// connection draining, it can take up to 60 seconds after the connection -// draining duration has elapsed before the VM instance is removed or deleted. -// You can specify a maximum of 1000 instances with this method per request. +// Update: Updates a HealthCheck resource in the specified project using the +// data included in the request. // -// - instanceGroupManager: Name of the managed instance group. +// - healthCheck: Name of the HealthCheck resource to update. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall { - c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionHealthChecksService) Update(project string, region string, healthCheck string, healthcheck *HealthCheck) *RegionHealthChecksUpdateCall { + c := &RegionHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest + c.healthCheck = healthCheck + c.healthcheck = healthcheck return c } @@ -6997,7 +7189,7 @@ func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, reg // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall { +func (c *RegionHealthChecksUpdateCall) RequestId(requestId string) *RegionHealthChecksUpdateCall { c.urlParams_.Set("requestId", requestId) return c } @@ -7005,56 +7197,56 @@ func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId str // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall { +func (c *RegionHealthChecksUpdateCall) Fields(s ...googleapi.Field) *RegionHealthChecksUpdateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall { +func (c *RegionHealthChecksUpdateCall) Context(ctx context.Context) *RegionHealthChecksUpdateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header { +func (c *RegionHealthChecksUpdateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.healthcheck) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/healthChecks/{healthCheck}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("POST", urls, body) + req, err := http.NewRequest("PUT", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, - "instanceGroupManager": c.instanceGroupManager, + "project": c.project, + "region": c.region, + "healthCheck": c.healthCheck, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call. +// Do executes the "compute.regionHealthChecks.update" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionHealthChecksUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7086,67 +7278,90 @@ func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.Ca return ret, nil } -type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersAbandonInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// DeletePerInstanceConfigs: Deletes selected per-instance configurations for -// the managed instance group. +// AbandonInstances: Flags the specified instances to be immediately removed +// from the managed instance group. Abandoning an instance does not delete the +// instance, but it does remove the instance from any target pools that are +// applied by the managed instance group. This method reduces the targetSize of +// the managed instance group by the number of instances that you abandon. This +// operation is marked as DONE when the action is scheduled even if the +// instances have not yet been removed from the group. You must separately +// verify the status of the abandoning action with the listmanagedinstances +// method. If the group is part of a backend service that has enabled +// connection draining, it can take up to 60 seconds after the connection +// draining duration has elapsed before the VM instance is removed or deleted. +// You can specify a maximum of 1000 instances with this method per request. // -// - instanceGroupManager: The name of the managed instance group. It should -// conform to RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request, should conform to -// RFC1035. -func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall { - c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: Name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) AbandonInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersabandoninstancesrequest *RegionInstanceGroupManagersAbandonInstancesRequest) *RegionInstanceGroupManagersAbandonInstancesCall { + c := &RegionInstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq + c.regioninstancegroupmanagersabandoninstancesrequest = regioninstancegroupmanagersabandoninstancesrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersAbandonInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersAbandonInstancesCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersAbandonInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersAbandonInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header { +func (c *RegionInstanceGroupManagersAbandonInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersabandoninstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -7161,12 +7376,12 @@ func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call. +// Do executes the "compute.regionInstanceGroupManagers.abandonInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersAbandonInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7198,72 +7413,69 @@ func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...goo return ret, nil } -type RegionInstanceGroupManagersGetCall struct { - s *Service - project string - region string - instanceGroupManager string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersApplyUpdatesToInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Get: Returns all of the details about the specified managed instance group. +// ApplyUpdatesToInstances: Apply updates to selected instances the managed +// instance group. // -// - instanceGroupManager: Name of the managed instance group to return. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall { - c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group, should +// conform to RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request, should conform to +// RFC1035. +func (r *RegionInstanceGroupManagersService) ApplyUpdatesToInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersapplyupdatesrequest *RegionInstanceGroupManagersApplyUpdatesRequest) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall { + c := &RegionInstanceGroupManagersApplyUpdatesToInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager + c.regioninstancegroupmanagersapplyupdatesrequest = regioninstancegroupmanagersapplyupdatesrequest return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall { +func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall { +func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersApplyUpdatesToInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersGetCall) Header() http.Header { +func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersapplyupdatesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -7276,13 +7488,12 @@ func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Respon return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.get" call. +// Do executes the "compute.regionInstanceGroupManagers.applyUpdatesToInstances" call. // Any non-2xx status code is an error. Response headers are in either -// *InstanceGroupManager.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersApplyUpdatesToInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7301,7 +7512,7 @@ func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (* if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &InstanceGroupManager{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7314,31 +7525,35 @@ func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (* return ret, nil } -type RegionInstanceGroupManagersInsertCall struct { - s *Service - project string - region string - instancegroupmanager *InstanceGroupManager - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersCreateInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Insert: Creates a managed instance group using the information that you -// specify in the request. After the group is created, instances in the group -// are created using the specified instance template. This operation is marked -// as DONE when the group is created even if the instances in the group have -// not yet been created. You must separately verify the status of the -// individual instances with the listmanagedinstances method. A regional -// managed instance group can contain up to 2000 instances. +// CreateInstances: Creates instances with per-instance configurations in this +// regional managed instance group. Instances are created using the current +// instance template. The create instances operation is marked DONE if the +// createInstances request is successful. The underlying actions take +// additional time. You must separately verify the status of the creating or +// actions with the listmanagedinstances method. // -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall { - c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group. It should +// conform to RFC1035. +// - project: Project ID for this request. +// - region: The name of the region where the managed instance group is +// located. It should conform to RFC1035. +func (r *RegionInstanceGroupManagersService) CreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagerscreateinstancesrequest *RegionInstanceGroupManagersCreateInstancesRequest) *RegionInstanceGroupManagersCreateInstancesCall { + c := &RegionInstanceGroupManagersCreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instancegroupmanager = instancegroupmanager + c.instanceGroupManager = instanceGroupManager + c.regioninstancegroupmanagerscreateinstancesrequest = regioninstancegroupmanagerscreateinstancesrequest return c } @@ -7348,11 +7563,10 @@ func (r *RegionInstanceGroupManagersService) Insert(project string, region strin // been completed. For example, consider a situation where you make an initial // request and the request times out. If you make the request again with the // same request ID, the server can check if original operation with the same -// request ID was received, and if so, will ignore the second request. This -// prevents clients from accidentally creating duplicate commitments. The +// request ID was received, and if so, will ignore the second request. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall { +func (c *RegionInstanceGroupManagersCreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersCreateInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -7360,36 +7574,36 @@ func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *Reg // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall { +func (c *RegionInstanceGroupManagersCreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersCreateInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall { +func (c *RegionInstanceGroupManagersCreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersCreateInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header { +func (c *RegionInstanceGroupManagersCreateInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersCreateInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerscreateinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/createInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -7397,18 +7611,19 @@ func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Res } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.insert" call. +// Do executes the "compute.regionInstanceGroupManagers.createInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersCreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7440,166 +7655,94 @@ func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionInstanceGroupManagersListCall struct { - s *Service - project string - region string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersDeleteCall struct { + s *Service + project string + region string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// List: Retrieves the list of managed instance groups that are contained -// within the specified region. +// Delete: Deletes the specified managed instance group and all of the +// instances in that group. // +// - instanceGroupManager: Name of the managed instance group to delete. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall { - c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionInstanceGroupManagersService) Delete(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersDeleteCall { + c := &RegionInstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region + c.instanceGroupManager = instanceGroupManager return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionInstanceGroupManagersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersDeleteCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall { +func (c *RegionInstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall { +func (c *RegionInstanceGroupManagersDeleteCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersListCall) Header() http.Header { +func (c *RegionInstanceGroupManagersDeleteCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("DELETE", urls, body) if err != nil { return nil, err } req.Header = reqHeaders googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "region": c.region, + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, }) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.list" call. +// Do executes the "compute.regionInstanceGroupManagers.delete" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionInstanceGroupManagerList.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7618,7 +7761,7 @@ func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) ( if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionInstanceGroupManagerList{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7631,177 +7774,91 @@ func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) ( return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionInstanceGroupManagersListErrorsCall struct { - s *Service - project string - region string - instanceGroupManager string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersDeleteInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListErrors: Lists all errors thrown by actions on instances for a given -// regional managed instance group. The filter and orderBy query parameters are -// not supported. +// DeleteInstances: Flags the specified instances in the managed instance group +// to be immediately deleted. The instances are also removed from any target +// pools of which they were a member. This method reduces the targetSize of the +// managed instance group by the number of instances that you delete. The +// deleteInstances operation is marked DONE if the deleteInstances request is +// successful. The underlying actions take additional time. You must separately +// verify the status of the deleting action with the listmanagedinstances +// method. If the group is part of a backend service that has enabled +// connection draining, it can take up to 60 seconds after the connection +// draining duration has elapsed before the VM instance is removed or deleted. +// You can specify a maximum of 1000 instances with this method per request. // -// - instanceGroupManager: The name of the managed instance group. It must be a -// string that meets the requirements in RFC1035, or an unsigned long -// integer: must match regexp pattern: (?:a-z -// (?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. This should conform to -// RFC1035. -func (r *RegionInstanceGroupManagersService) ListErrors(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListErrorsCall { - c := &RegionInstanceGroupManagersListErrorsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: Name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) DeleteInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersdeleteinstancesrequest *RegionInstanceGroupManagersDeleteInstancesRequest) *RegionInstanceGroupManagersDeleteInstancesCall { + c := &RegionInstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager + c.regioninstancegroupmanagersdeleteinstancesrequest = regioninstancegroupmanagersdeleteinstancesrequest return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionInstanceGroupManagersListErrorsCall) Filter(filter string) *RegionInstanceGroupManagersListErrorsCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionInstanceGroupManagersListErrorsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListErrorsCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionInstanceGroupManagersListErrorsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListErrorsCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionInstanceGroupManagersListErrorsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListErrorsCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionInstanceGroupManagersListErrorsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListErrorsCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersDeleteInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersDeleteInstancesCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersListErrorsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListErrorsCall { +func (c *RegionInstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeleteInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *RegionInstanceGroupManagersListErrorsCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListErrorsCall { - c.ifNoneMatch_ = entityTag - return c -} - // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersListErrorsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListErrorsCall { +func (c *RegionInstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeleteInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersListErrorsCall) Header() http.Header { +func (c *RegionInstanceGroupManagersDeleteInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } +func (c *RegionInstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersdeleteinstancesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -7814,13 +7871,12 @@ func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.listErrors" call. +// Do executes the "compute.regionInstanceGroupManagers.deleteInstances" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionInstanceGroupManagersListErrorsResponse.ServerResponse.Header or (if -// a response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersListErrorsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListErrorsResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersDeleteInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -7839,7 +7895,7 @@ func (c *RegionInstanceGroupManagersListErrorsCall) Do(opts ...googleapi.CallOpt if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionInstanceGroupManagersListErrorsResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -7852,162 +7908,67 @@ func (c *RegionInstanceGroupManagersListErrorsCall) Do(opts ...googleapi.CallOpt return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionInstanceGroupManagersListErrorsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListErrorsResponse) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionInstanceGroupManagersListManagedInstancesCall struct { - s *Service - project string - region string - instanceGroupManager string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersDeletePerInstanceConfigsCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// ListManagedInstances: Lists the instances in the managed instance group and -// instances that are scheduled to be created. The list includes any current -// actions that the group has scheduled for its instances. The orderBy query -// parameter is not supported. The `pageToken` query parameter is supported -// only if the group's `listManagedInstancesResults` field is set to -// `PAGINATED`. +// DeletePerInstanceConfigs: Deletes selected per-instance configurations for +// the managed instance group. // -// - instanceGroupManager: The name of the managed instance group. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall { - c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group. It should +// conform to RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request, should conform to +// RFC1035. +func (r *RegionInstanceGroupManagersService) DeletePerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerdeleteinstanceconfigreq *RegionInstanceGroupManagerDeleteInstanceConfigReq) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall { + c := &RegionInstanceGroupManagersDeletePerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - return c -} - -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall { - c.urlParams_.Set("filter", filter) - return c -} - -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) - return c -} - -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall { - c.urlParams_.Set("orderBy", orderBy) - return c -} - -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListManagedInstancesCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + c.regioninstancegroupmanagerdeleteinstanceconfigreq = regioninstancegroupmanagerdeleteinstanceconfigreq return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall { +func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall { +func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersDeletePerInstanceConfigsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header { +func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerdeleteinstanceconfigreq) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8022,13 +7983,12 @@ func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt stri return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call. +// Do executes the "compute.regionInstanceGroupManagers.deletePerInstanceConfigs" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Header or -// (if a response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersDeletePerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8047,7 +8007,7 @@ func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googlea if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionInstanceGroupManagersListInstancesResponse{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8060,161 +8020,1569 @@ func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googlea return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error { +type RegionInstanceGroupManagersGetCall struct { + s *Service + project string + region string + instanceGroupManager string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Get: Returns all of the details about the specified managed instance group. +// +// - instanceGroupManager: Name of the managed instance group to return. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) Get(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersGetCall { + c := &RegionInstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionInstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersGetCall) Context(ctx context.Context) *RegionInstanceGroupManagersGetCall { c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersGetCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.get" call. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupManager.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *RegionInstanceGroupManagersGetCall) Do(opts ...googleapi.CallOption) (*InstanceGroupManager, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() } - c.PageToken(x.NextPageToken) + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &InstanceGroupManager{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil } -type RegionInstanceGroupManagersListPerInstanceConfigsCall struct { +type RegionInstanceGroupManagersInsertCall struct { s *Service project string region string - instanceGroupManager string + instancegroupmanager *InstanceGroupManager urlParams_ gensupport.URLParams ctx_ context.Context header_ http.Header } -// ListPerInstanceConfigs: Lists all of the per-instance configurations defined -// for the managed instance group. The orderBy query parameter is not -// supported. +// Insert: Creates a managed instance group using the information that you +// specify in the request. After the group is created, instances in the group +// are created using the specified instance template. This operation is marked +// as DONE when the group is created even if the instances in the group have +// not yet been created. You must separately verify the status of the +// individual instances with the listmanagedinstances method. A regional +// managed instance group can contain up to 2000 instances. // -// - instanceGroupManager: The name of the managed instance group. It should -// conform to RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request, should conform to -// RFC1035. -func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { - c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) Insert(project string, region string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersInsertCall { + c := &RegionInstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region - c.instanceGroupManager = instanceGroupManager + c.instancegroupmanager = instancegroupmanager return c } -// Filter sets the optional parameter "filter": A filter expression that -// filters resources listed in the response. Most Compute resources support two -// types of filter expressions: expressions that support regular expressions -// and expressions that follow API improvement proposal AIP-160. These two -// types of filter expressions cannot be mixed in one request. If you want to -// use AIP-160, your expression must specify the field name, an operator, and -// the value that you want to use for filtering. The value must be a string, a -// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, -// `>=` or `:`. For example, if you are filtering Compute Engine instances, you -// can exclude instances named `example-instance` by specifying `name != -// example-instance`. The `:*` comparison can be used to test whether a key has -// been defined. For example, to find all objects with `owner` label use: ``` -// labels.owner:* ``` You can also filter nested fields. For example, you could -// specify `scheduling.automaticRestart = false` to include instances only if -// they are not scheduled for automatic restarts. You can use filtering on -// nested fields to filter based on resource labels. To filter on multiple -// expressions, provide each separate expression within parentheses. For -// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel -// Skylake") ``` By default, each expression is an `AND` expression. However, -// you can include `AND` and `OR` expressions explicitly. For example: ``` -// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND -// (scheduling.automaticRestart = true) ``` If you want to use a regular -// expression, use the `eq` (equal) or `ne` (not equal) operator against a -// single un-parenthesized expression with or without quotes or against -// multiple parenthesized expressions. Examples: `fieldname eq unquoted -// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted -// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal -// value is interpreted as a regular expression using Google RE2 library -// syntax. The literal value must match the entire field. For example, to -// filter for instances that do not end with name "instance", you would use -// `name ne .*instance`. You cannot combine constraints on multiple fields -// using regular expressions. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { - c.urlParams_.Set("filter", filter) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersInsertCall) RequestId(requestId string) *RegionInstanceGroupManagersInsertCall { + c.urlParams_.Set("requestId", requestId) return c } -// MaxResults sets the optional parameter "maxResults": The maximum number of -// results per page that should be returned. If the number of available results -// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that -// can be used to get the next page of results in subsequent list requests. -// Acceptable values are `0` to `500`, inclusive. (Default: `500`) -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall { - c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersInsertCall) Context(ctx context.Context) *RegionInstanceGroupManagersInsertCall { + c.ctx_ = ctx return c } -// OrderBy sets the optional parameter "orderBy": Sorts list results by a -// certain order. By default, results are returned in alphanumerical order -// based on the resource name. You can also sort results in descending order -// based on the creation timestamp using `orderBy="creationTimestamp desc". -// This sorts results based on the `creationTimestamp` field in reverse -// chronological order (newest result first). Use this to sort resources like -// operations so that the newest operation is returned first. Currently, only -// sorting by `name` or `creationTimestamp desc` is supported. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { - c.urlParams_.Set("orderBy", orderBy) - return c +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersInsertCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.insert" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type RegionInstanceGroupManagersListCall struct { + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// List: Retrieves the list of managed instance groups that are contained +// within the specified region. +// +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) List(project string, region string) *RegionInstanceGroupManagersListCall { + c := &RegionInstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionInstanceGroupManagersListCall) Filter(filter string) *RegionInstanceGroupManagersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionInstanceGroupManagersListCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionInstanceGroupManagersListCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionInstanceGroupManagersListCall) PageToken(pageToken string) *RegionInstanceGroupManagersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionInstanceGroupManagersListCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersListCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionInstanceGroupManagersListCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersListCall) Context(ctx context.Context) *RegionInstanceGroupManagersListCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersListCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.list" call. +// Any non-2xx status code is an error. Response headers are in either +// *RegionInstanceGroupManagerList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersListCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagerList, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RegionInstanceGroupManagerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionInstanceGroupManagersListCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagerList) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type RegionInstanceGroupManagersListErrorsCall struct { + s *Service + project string + region string + instanceGroupManager string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ListErrors: Lists all errors thrown by actions on instances for a given +// regional managed instance group. The filter and orderBy query parameters are +// not supported. +// +// - instanceGroupManager: The name of the managed instance group. It must be a +// string that meets the requirements in RFC1035, or an unsigned long +// integer: must match regexp pattern: (?:a-z +// (?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. This should conform to +// RFC1035. +func (r *RegionInstanceGroupManagersService) ListErrors(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListErrorsCall { + c := &RegionInstanceGroupManagersListErrorsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionInstanceGroupManagersListErrorsCall) Filter(filter string) *RegionInstanceGroupManagersListErrorsCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionInstanceGroupManagersListErrorsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListErrorsCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionInstanceGroupManagersListErrorsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListErrorsCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionInstanceGroupManagersListErrorsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListErrorsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionInstanceGroupManagersListErrorsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListErrorsCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersListErrorsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListErrorsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *RegionInstanceGroupManagersListErrorsCall) IfNoneMatch(entityTag string) *RegionInstanceGroupManagersListErrorsCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersListErrorsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListErrorsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersListErrorsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersListErrorsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listErrors") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.listErrors" call. +// Any non-2xx status code is an error. Response headers are in either +// *RegionInstanceGroupManagersListErrorsResponse.ServerResponse.Header or (if +// a response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersListErrorsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListErrorsResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RegionInstanceGroupManagersListErrorsResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionInstanceGroupManagersListErrorsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListErrorsResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type RegionInstanceGroupManagersListManagedInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ListManagedInstances: Lists the instances in the managed instance group and +// instances that are scheduled to be created. The list includes any current +// actions that the group has scheduled for its instances. The orderBy query +// parameter is not supported. The `pageToken` query parameter is supported +// only if the group's `listManagedInstancesResults` field is set to +// `PAGINATED`. +// +// - instanceGroupManager: The name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) ListManagedInstances(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListManagedInstancesCall { + c := &RegionInstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) Filter(filter string) *RegionInstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionInstanceGroupManagersListManagedInstancesCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) PageToken(pageToken string) *RegionInstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersListManagedInstancesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.listManagedInstances" call. +// Any non-2xx status code is an error. Response headers are in either +// *RegionInstanceGroupManagersListInstancesResponse.ServerResponse.Header or +// (if a response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstancesResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RegionInstanceGroupManagersListInstancesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionInstanceGroupManagersListManagedInstancesCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstancesResponse) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type RegionInstanceGroupManagersListPerInstanceConfigsCall struct { + s *Service + project string + region string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// ListPerInstanceConfigs: Lists all of the per-instance configurations defined +// for the managed instance group. The orderBy query parameter is not +// supported. +// +// - instanceGroupManager: The name of the managed instance group. It should +// conform to RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request, should conform to +// RFC1035. +func (r *RegionInstanceGroupManagersService) ListPerInstanceConfigs(project string, region string, instanceGroupManager string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c := &RegionInstanceGroupManagersListPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + return c +} + +// Filter sets the optional parameter "filter": A filter expression that +// filters resources listed in the response. Most Compute resources support two +// types of filter expressions: expressions that support regular expressions +// and expressions that follow API improvement proposal AIP-160. These two +// types of filter expressions cannot be mixed in one request. If you want to +// use AIP-160, your expression must specify the field name, an operator, and +// the value that you want to use for filtering. The value must be a string, a +// number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, +// `>=` or `:`. For example, if you are filtering Compute Engine instances, you +// can exclude instances named `example-instance` by specifying `name != +// example-instance`. The `:*` comparison can be used to test whether a key has +// been defined. For example, to find all objects with `owner` label use: ``` +// labels.owner:* ``` You can also filter nested fields. For example, you could +// specify `scheduling.automaticRestart = false` to include instances only if +// they are not scheduled for automatic restarts. You can use filtering on +// nested fields to filter based on resource labels. To filter on multiple +// expressions, provide each separate expression within parentheses. For +// example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel +// Skylake") ``` By default, each expression is an `AND` expression. However, +// you can include `AND` and `OR` expressions explicitly. For example: ``` +// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND +// (scheduling.automaticRestart = true) ``` If you want to use a regular +// expression, use the `eq` (equal) or `ne` (not equal) operator against a +// single un-parenthesized expression with or without quotes or against +// multiple parenthesized expressions. Examples: `fieldname eq unquoted +// literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted +// literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal +// value is interpreted as a regular expression using Google RE2 library +// syntax. The literal value must match the entire field. For example, to +// filter for instances that do not end with name "instance", you would use +// `name ne .*instance`. You cannot combine constraints on multiple fields +// using regular expressions. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Filter(filter string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": The maximum number of +// results per page that should be returned. If the number of available results +// is larger than `maxResults`, Compute Engine returns a `nextPageToken` that +// can be used to get the next page of results in subsequent list requests. +// Acceptable values are `0` to `500`, inclusive. (Default: `500`) +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) MaxResults(maxResults int64) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// OrderBy sets the optional parameter "orderBy": Sorts list results by a +// certain order. By default, results are returned in alphanumerical order +// based on the resource name. You can also sort results in descending order +// based on the creation timestamp using `orderBy="creationTimestamp desc". +// This sorts results based on the `creationTimestamp` field in reverse +// chronological order (newest result first). Use this to sort resources like +// operations so that the newest operation is returned first. Currently, only +// sorting by `name` or `creationTimestamp desc` is supported. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) OrderBy(orderBy string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.urlParams_.Set("orderBy", orderBy) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page token to +// use. Set `pageToken` to the `nextPageToken` returned by a previous list +// request to get the next page of results. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": +// Opt-in for partial success behavior which provides partial results in case +// of failure. The default value is false. For example, when partial success +// behavior is enabled, aggregatedList for a single zone scope either returns +// all resources in the zone or no resources, with an error code. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call. +// Any non-2xx status code is an error. Response headers are in either +// *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Header or +// (if a response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &RegionInstanceGroupManagersListInstanceConfigsResp{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +// Pages invokes f for each page of results. +// A non-nil error returned from f will halt the iteration. +// The provided context supersedes any context provided to the Context method. +func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) error) error { + c.ctx_ = ctx + defer c.PageToken(c.urlParams_.Get("pageToken")) + for { + x, err := c.Do() + if err != nil { + return err + } + if err := f(x); err != nil { + return err + } + if x.NextPageToken == "" { + return nil + } + c.PageToken(x.NextPageToken) + } +} + +type RegionInstanceGroupManagersPatchCall struct { + s *Service + project string + region string + instanceGroupManager string + instancegroupmanager *InstanceGroupManager + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// Patch: Updates a managed instance group using the information that you +// specify in the request. This operation is marked as DONE when the group is +// patched even if the instances in the group are still in the process of being +// patched. You must separately verify the status of the individual instances +// with the listmanagedinstances method. This method supports PATCH semantics +// and uses the JSON merge patch format and processing rules. If you update +// your group to specify a new template or instance configuration, it's +// possible that your intended specification for each VM in the group is +// different from the current state of that VM. To learn how to apply an +// updated configuration to the VMs in a MIG, see Updating instances in a MIG. +// +// - instanceGroupManager: The name of the instance group manager. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall { + c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanager = instancegroupmanager + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("PATCH", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.patch" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type RegionInstanceGroupManagersPatchPerInstanceConfigsCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// PatchPerInstanceConfigs: Inserts or patches per-instance configurations for +// the managed instance group. perInstanceConfig.name serves as a key used to +// distinguish whether to perform insert or patch. +// +// - instanceGroupManager: The name of the managed instance group. It should +// conform to RFC1035. +// - project: Project ID for this request. +// - region: Name of the region scoping this request, should conform to +// RFC1035. +func (r *RegionInstanceGroupManagersService) PatchPerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { + c := &RegionInstanceGroupManagersPatchPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + c.regioninstancegroupmanagerpatchinstanceconfigreq = regioninstancegroupmanagerpatchinstanceconfigreq + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.patchPerInstanceConfigs" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type RegionInstanceGroupManagersRecreateInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// RecreateInstances: Flags the specified VM instances in the managed instance +// group to be immediately recreated. Each instance is recreated using the +// group's current configuration. This operation is marked as DONE when the +// flag is set even if the instances have not yet been recreated. You must +// separately verify the status of each instance by checking its currentAction +// field; for more information, see Checking the status of managed instances. +// If the group is part of a backend service that has enabled connection +// draining, it can take up to 60 seconds after the connection draining +// duration has elapsed before the VM instance is removed or deleted. You can +// specify a maximum of 1000 instances with this method per request. +// +// - instanceGroupManager: Name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall { + c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "instanceGroupManager": c.instanceGroupManager, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + +type RegionInstanceGroupManagersResizeCall struct { + s *Service + project string + region string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PageToken sets the optional parameter "pageToken": Specifies a page token to -// use. Set `pageToken` to the `nextPageToken` returned by a previous list -// request to get the next page of results. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) PageToken(pageToken string) *RegionInstanceGroupManagersListPerInstanceConfigsCall { - c.urlParams_.Set("pageToken", pageToken) +// Resize: Changes the intended size of the managed instance group. If you +// increase the size, the group creates new instances using the current +// instance template. If you decrease the size, the group deletes one or more +// instances. The resize operation is marked DONE if the resize request is +// successful. The underlying actions take additional time. You must separately +// verify the status of the creating or deleting actions with the +// listmanagedinstances method. If the group is part of a backend service that +// has enabled connection draining, it can take up to 60 seconds after the +// connection draining duration has elapsed before the VM instance is removed +// or deleted. +// +// - instanceGroupManager: Name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +// - size: Number of instances that should exist in this instance group +// manager. +func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall { + c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.instanceGroupManager = instanceGroupManager + c.urlParams_.Set("size", fmt.Sprint(size)) return c } -// ReturnPartialSuccess sets the optional parameter "returnPartialSuccess": -// Opt-in for partial success behavior which provides partial results in case -// of failure. The default value is false. For example, when partial success -// behavior is enabled, aggregatedList for a single zone scope either returns -// all resources in the zone or no resources, with an error code. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) ReturnPartialSuccess(returnPartialSuccess bool) *RegionInstanceGroupManagersListPerInstanceConfigsCall { - c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess)) +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall { + c.urlParams_.Set("requestId", requestId) return c } // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersListPerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersListPerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Header() http.Header { +func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) var body io.Reader = nil c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8229,13 +9597,12 @@ func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) doRequest(alt st return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.listPerInstanceConfigs" call. +// Do executes the "compute.regionInstanceGroupManagers.resize" call. // Any non-2xx status code is an error. Response headers are in either -// *RegionInstanceGroupManagersListInstanceConfigsResp.ServerResponse.Header or -// (if a response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*RegionInstanceGroupManagersListInstanceConfigsResp, error) { +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8254,7 +9621,7 @@ func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googl if err := googleapi.CheckResponse(res); err != nil { return nil, gensupport.WrapError(err) } - ret := &RegionInstanceGroupManagersListInstanceConfigsResp{ + ret := &Operation{ ServerResponse: googleapi.ServerResponse{ Header: res.Header, HTTPStatusCode: res.StatusCode, @@ -8267,58 +9634,40 @@ func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Do(opts ...googl return ret, nil } -// Pages invokes f for each page of results. -// A non-nil error returned from f will halt the iteration. -// The provided context supersedes any context provided to the Context method. -func (c *RegionInstanceGroupManagersListPerInstanceConfigsCall) Pages(ctx context.Context, f func(*RegionInstanceGroupManagersListInstanceConfigsResp) error) error { - c.ctx_ = ctx - defer c.PageToken(c.urlParams_.Get("pageToken")) - for { - x, err := c.Do() - if err != nil { - return err - } - if err := f(x); err != nil { - return err - } - if x.NextPageToken == "" { - return nil - } - c.PageToken(x.NextPageToken) - } -} - -type RegionInstanceGroupManagersPatchCall struct { - s *Service - project string - region string - instanceGroupManager string - instancegroupmanager *InstanceGroupManager - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersResumeInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersresumeinstancesrequest *RegionInstanceGroupManagersResumeInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Patch: Updates a managed instance group using the information that you -// specify in the request. This operation is marked as DONE when the group is -// patched even if the instances in the group are still in the process of being -// patched. You must separately verify the status of the individual instances -// with the listmanagedinstances method. This method supports PATCH semantics -// and uses the JSON merge patch format and processing rules. If you update -// your group to specify a new template or instance configuration, it's -// possible that your intended specification for each VM in the group is -// different from the current state of that VM. To learn how to apply an -// updated configuration to the VMs in a MIG, see Updating instances in a MIG. +// ResumeInstances: Flags the specified instances in the managed instance group +// to be resumed. This method increases the targetSize and decreases the +// targetSuspendedSize of the managed instance group by the number of instances +// that you resume. The resumeInstances operation is marked DONE if the +// resumeInstances request is successful. The underlying actions take +// additional time. You must separately verify the status of the RESUMING +// action with the listmanagedinstances method. In this request, you can only +// specify instances that are suspended. For example, if an instance was +// previously suspended using the suspendInstances method, it can be resumed +// using the resumeInstances method. If a health check is attached to the +// managed instance group, the specified instances will be verified as healthy +// after they are resumed. You can specify a maximum of 1000 instances with +// this method per request. // -// - instanceGroupManager: The name of the instance group manager. +// - instanceGroupManager: Name of the managed instance group. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) Patch(project string, region string, instanceGroupManager string, instancegroupmanager *InstanceGroupManager) *RegionInstanceGroupManagersPatchCall { - c := &RegionInstanceGroupManagersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionInstanceGroupManagersService) ResumeInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersresumeinstancesrequest *RegionInstanceGroupManagersResumeInstancesRequest) *RegionInstanceGroupManagersResumeInstancesCall { + c := &RegionInstanceGroupManagersResumeInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.instancegroupmanager = instancegroupmanager + c.regioninstancegroupmanagersresumeinstancesrequest = regioninstancegroupmanagersresumeinstancesrequest return c } @@ -8332,7 +9681,7 @@ func (r *RegionInstanceGroupManagersService) Patch(project string, region string // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchCall { +func (c *RegionInstanceGroupManagersResumeInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersResumeInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -8340,38 +9689,38 @@ func (c *RegionInstanceGroupManagersPatchCall) RequestId(requestId string) *Regi // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersPatchCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchCall { +func (c *RegionInstanceGroupManagersResumeInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResumeInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersPatchCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchCall { +func (c *RegionInstanceGroupManagersResumeInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersResumeInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersPatchCall) Header() http.Header { +func (c *RegionInstanceGroupManagersResumeInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersResumeInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersresumeinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resumeInstances") urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("PATCH", urls, body) + req, err := http.NewRequest("POST", urls, body) if err != nil { return nil, err } @@ -8384,12 +9733,12 @@ func (c *RegionInstanceGroupManagersPatchCall) doRequest(alt string) (*http.Resp return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.patch" call. +// Do executes the "compute.regionInstanceGroupManagers.resumeInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersResumeInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8421,32 +9770,30 @@ func (c *RegionInstanceGroupManagersPatchCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionInstanceGroupManagersPatchPerInstanceConfigsCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersSetInstanceTemplateCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// PatchPerInstanceConfigs: Inserts or patches per-instance configurations for -// the managed instance group. perInstanceConfig.name serves as a key used to -// distinguish whether to perform insert or patch. +// SetInstanceTemplate: Sets the instance template to use when creating new +// instances or recreating instances in this group. Existing instances are not +// affected. // -// - instanceGroupManager: The name of the managed instance group. It should -// conform to RFC1035. -// - project: Project ID for this request. -// - region: Name of the region scoping this request, should conform to -// RFC1035. -func (r *RegionInstanceGroupManagersService) PatchPerInstanceConfigs(project string, region string, instanceGroupManager string, regioninstancegroupmanagerpatchinstanceconfigreq *RegionInstanceGroupManagerPatchInstanceConfigReq) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { - c := &RegionInstanceGroupManagersPatchPerInstanceConfigsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: The name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall { + c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagerpatchinstanceconfigreq = regioninstancegroupmanagerpatchinstanceconfigreq + c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest return c } @@ -8460,7 +9807,7 @@ func (r *RegionInstanceGroupManagersService) PatchPerInstanceConfigs(project str // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(requestId string) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall { c.urlParams_.Set("requestId", requestId) return c } @@ -8468,36 +9815,36 @@ func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) RequestId(reque // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Context(ctx context.Context) *RegionInstanceGroupManagersPatchPerInstanceConfigsCall { +func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Header() http.Header { +func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerpatchinstanceconfigreq) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/patchPerInstanceConfigs") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8512,12 +9859,12 @@ func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) doRequest(alt s return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.patchPerInstanceConfigs" call. +// Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8549,37 +9896,29 @@ func (c *RegionInstanceGroupManagersPatchPerInstanceConfigsCall) Do(opts ...goog return ret, nil } -type RegionInstanceGroupManagersRecreateInstancesCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersSetTargetPoolsCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// RecreateInstances: Flags the specified VM instances in the managed instance -// group to be immediately recreated. Each instance is recreated using the -// group's current configuration. This operation is marked as DONE when the -// flag is set even if the instances have not yet been recreated. You must -// separately verify the status of each instance by checking its currentAction -// field; for more information, see Checking the status of managed instances. -// If the group is part of a backend service that has enabled connection -// draining, it can take up to 60 seconds after the connection draining -// duration has elapsed before the VM instance is removed or deleted. You can -// specify a maximum of 1000 instances with this method per request. +// SetTargetPools: Modifies the target pools to which all new instances in this +// group are assigned. Existing instances in the group are not affected. // // - instanceGroupManager: Name of the managed instance group. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersrecreaterequest *RegionInstanceGroupManagersRecreateRequest) *RegionInstanceGroupManagersRecreateInstancesCall { - c := &RegionInstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall { + c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagersrecreaterequest = regioninstancegroupmanagersrecreaterequest + c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest return c } @@ -8593,7 +9932,7 @@ func (r *RegionInstanceGroupManagersService) RecreateInstances(project string, r // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersRecreateInstancesCall { +func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall { c.urlParams_.Set("requestId", requestId) return c } @@ -8601,36 +9940,36 @@ func (c *RegionInstanceGroupManagersRecreateInstancesCall) RequestId(requestId s // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersRecreateInstancesCall { +func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersRecreateInstancesCall { +func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersRecreateInstancesCall) Header() http.Header { +func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersrecreaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8645,12 +9984,12 @@ func (c *RegionInstanceGroupManagersRecreateInstancesCall) doRequest(alt string) return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.recreateInstances" call. +// Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8682,38 +10021,39 @@ func (c *RegionInstanceGroupManagersRecreateInstancesCall) Do(opts ...googleapi. return ret, nil } -type RegionInstanceGroupManagersResizeCall struct { - s *Service - project string - region string - instanceGroupManager string - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersStartInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersstartinstancesrequest *RegionInstanceGroupManagersStartInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// Resize: Changes the intended size of the managed instance group. If you -// increase the size, the group creates new instances using the current -// instance template. If you decrease the size, the group deletes one or more -// instances. The resize operation is marked DONE if the resize request is -// successful. The underlying actions take additional time. You must separately -// verify the status of the creating or deleting actions with the -// listmanagedinstances method. If the group is part of a backend service that -// has enabled connection draining, it can take up to 60 seconds after the -// connection draining duration has elapsed before the VM instance is removed -// or deleted. +// StartInstances: Flags the specified instances in the managed instance group +// to be started. This method increases the targetSize and decreases the +// targetStoppedSize of the managed instance group by the number of instances +// that you start. The startInstances operation is marked DONE if the +// startInstances request is successful. The underlying actions take additional +// time. You must separately verify the status of the STARTING action with the +// listmanagedinstances method. In this request, you can only specify instances +// that are stopped. For example, if an instance was previously stopped using +// the stopInstances method, it can be started using the startInstances method. +// If a health check is attached to the managed instance group, the specified +// instances will be verified as healthy after they are started. You can +// specify a maximum of 1000 instances with this method per request. // -// - instanceGroupManager: Name of the managed instance group. -// - project: Project ID for this request. -// - region: Name of the region scoping this request. -// - size: Number of instances that should exist in this instance group -// manager. -func (r *RegionInstanceGroupManagersService) Resize(project string, region string, instanceGroupManager string, size int64) *RegionInstanceGroupManagersResizeCall { - c := &RegionInstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)} +// - instanceGroupManager: Name of the managed instance group. +// - project: Project ID for this request. +// - region: Name of the region scoping this request. +func (r *RegionInstanceGroupManagersService) StartInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersstartinstancesrequest *RegionInstanceGroupManagersStartInstancesRequest) *RegionInstanceGroupManagersStartInstancesCall { + c := &RegionInstanceGroupManagersStartInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.urlParams_.Set("size", fmt.Sprint(size)) + c.regioninstancegroupmanagersstartinstancesrequest = regioninstancegroupmanagersstartinstancesrequest return c } @@ -8727,7 +10067,7 @@ func (r *RegionInstanceGroupManagersService) Resize(project string, region strin // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *RegionInstanceGroupManagersResizeCall { +func (c *RegionInstanceGroupManagersStartInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersStartInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -8735,32 +10075,36 @@ func (c *RegionInstanceGroupManagersResizeCall) RequestId(requestId string) *Reg // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersResizeCall { +func (c *RegionInstanceGroupManagersStartInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersStartInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersResizeCall) Context(ctx context.Context) *RegionInstanceGroupManagersResizeCall { +func (c *RegionInstanceGroupManagersStartInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersStartInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersResizeCall) Header() http.Header { +func (c *RegionInstanceGroupManagersStartInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) +func (c *RegionInstanceGroupManagersStartInstancesCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstartinstancesrequest) + if err != nil { + return nil, err + } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/startInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8775,12 +10119,12 @@ func (c *RegionInstanceGroupManagersResizeCall) doRequest(alt string) (*http.Res return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.resize" call. +// Do executes the "compute.regionInstanceGroupManagers.startInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersStartInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8812,30 +10156,45 @@ func (c *RegionInstanceGroupManagersResizeCall) Do(opts ...googleapi.CallOption) return ret, nil } -type RegionInstanceGroupManagersSetInstanceTemplateCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersStopInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagersstopinstancesrequest *RegionInstanceGroupManagersStopInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetInstanceTemplate: Sets the instance template to use when creating new -// instances or recreating instances in this group. Existing instances are not -// affected. +// StopInstances: Flags the specified instances in the managed instance group +// to be immediately stopped. You can only specify instances that are running +// in this request. This method reduces the targetSize and increases the +// targetStoppedSize of the managed instance group by the number of instances +// that you stop. The stopInstances operation is marked DONE if the +// stopInstances request is successful. The underlying actions take additional +// time. You must separately verify the status of the STOPPING action with the +// listmanagedinstances method. If the standbyPolicy.initialDelaySec field is +// set, the group delays stopping the instances until initialDelaySec have +// passed from instance.creationTimestamp (that is, when the instance was +// created). This delay gives your application time to set itself up and +// initialize on the instance. If more than initialDelaySec seconds have passed +// since instance.creationTimestamp when this method is called, there will be +// zero delay. If the group is part of a backend service that has enabled +// connection draining, it can take up to 60 seconds after the connection +// draining duration has elapsed before the VM instance is stopped. Stopped +// instances can be started using the startInstances method. You can specify a +// maximum of 1000 instances with this method per request. // // - instanceGroupManager: The name of the managed instance group. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettemplaterequest *RegionInstanceGroupManagersSetTemplateRequest) *RegionInstanceGroupManagersSetInstanceTemplateCall { - c := &RegionInstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionInstanceGroupManagersService) StopInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagersstopinstancesrequest *RegionInstanceGroupManagersStopInstancesRequest) *RegionInstanceGroupManagersStopInstancesCall { + c := &RegionInstanceGroupManagersStopInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagerssettemplaterequest = regioninstancegroupmanagerssettemplaterequest + c.regioninstancegroupmanagersstopinstancesrequest = regioninstancegroupmanagersstopinstancesrequest return c } @@ -8849,7 +10208,7 @@ func (r *RegionInstanceGroupManagersService) SetInstanceTemplate(project string, // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId string) *RegionInstanceGroupManagersSetInstanceTemplateCall { +func (c *RegionInstanceGroupManagersStopInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersStopInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -8857,36 +10216,36 @@ func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) RequestId(requestId // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetInstanceTemplateCall { +func (c *RegionInstanceGroupManagersStopInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersStopInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetInstanceTemplateCall { +func (c *RegionInstanceGroupManagersStopInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersStopInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Header() http.Header { +func (c *RegionInstanceGroupManagersStopInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersStopInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettemplaterequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagersstopinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/stopInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -8901,12 +10260,12 @@ func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) doRequest(alt strin return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.setInstanceTemplate" call. +// Do executes the "compute.regionInstanceGroupManagers.stopInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersStopInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -8938,29 +10297,46 @@ func (c *RegionInstanceGroupManagersSetInstanceTemplateCall) Do(opts ...googleap return ret, nil } -type RegionInstanceGroupManagersSetTargetPoolsCall struct { - s *Service - project string - region string - instanceGroupManager string - regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest - urlParams_ gensupport.URLParams - ctx_ context.Context - header_ http.Header +type RegionInstanceGroupManagersSuspendInstancesCall struct { + s *Service + project string + region string + instanceGroupManager string + regioninstancegroupmanagerssuspendinstancesrequest *RegionInstanceGroupManagersSuspendInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header } -// SetTargetPools: Modifies the target pools to which all new instances in this -// group are assigned. Existing instances in the group are not affected. +// SuspendInstances: Flags the specified instances in the managed instance +// group to be immediately suspended. You can only specify instances that are +// running in this request. This method reduces the targetSize and increases +// the targetSuspendedSize of the managed instance group by the number of +// instances that you suspend. The suspendInstances operation is marked DONE if +// the suspendInstances request is successful. The underlying actions take +// additional time. You must separately verify the status of the SUSPENDING +// action with the listmanagedinstances method. If the +// standbyPolicy.initialDelaySec field is set, the group delays suspension of +// the instances until initialDelaySec have passed from +// instance.creationTimestamp (that is, when the instance was created). This +// delay gives your application time to set itself up and initialize on the +// instance. If more than initialDelaySec seconds have passed since +// instance.creationTimestamp when this method is called, there will be zero +// delay. If the group is part of a backend service that has enabled connection +// draining, it can take up to 60 seconds after the connection draining +// duration has elapsed before the VM instance is suspended. Suspended +// instances can be resumed using the resumeInstances method. You can specify a +// maximum of 1000 instances with this method per request. // // - instanceGroupManager: Name of the managed instance group. // - project: Project ID for this request. // - region: Name of the region scoping this request. -func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssettargetpoolsrequest *RegionInstanceGroupManagersSetTargetPoolsRequest) *RegionInstanceGroupManagersSetTargetPoolsCall { - c := &RegionInstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)} +func (r *RegionInstanceGroupManagersService) SuspendInstances(project string, region string, instanceGroupManager string, regioninstancegroupmanagerssuspendinstancesrequest *RegionInstanceGroupManagersSuspendInstancesRequest) *RegionInstanceGroupManagersSuspendInstancesCall { + c := &RegionInstanceGroupManagersSuspendInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.instanceGroupManager = instanceGroupManager - c.regioninstancegroupmanagerssettargetpoolsrequest = regioninstancegroupmanagerssettargetpoolsrequest + c.regioninstancegroupmanagerssuspendinstancesrequest = regioninstancegroupmanagerssuspendinstancesrequest return c } @@ -8974,7 +10350,7 @@ func (r *RegionInstanceGroupManagersService) SetTargetPools(project string, regi // prevents clients from accidentally creating duplicate commitments. The // request ID must be a valid UUID with the exception that zero UUID is not // supported ( 00000000-0000-0000-0000-000000000000). -func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId string) *RegionInstanceGroupManagersSetTargetPoolsCall { +func (c *RegionInstanceGroupManagersSuspendInstancesCall) RequestId(requestId string) *RegionInstanceGroupManagersSuspendInstancesCall { c.urlParams_.Set("requestId", requestId) return c } @@ -8982,36 +10358,36 @@ func (c *RegionInstanceGroupManagersSetTargetPoolsCall) RequestId(requestId stri // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more // details. -func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSetTargetPoolsCall { +func (c *RegionInstanceGroupManagersSuspendInstancesCall) Fields(s ...googleapi.Field) *RegionInstanceGroupManagersSuspendInstancesCall { c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } // Context sets the context to be used in this call's Do method. -func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *RegionInstanceGroupManagersSetTargetPoolsCall { +func (c *RegionInstanceGroupManagersSuspendInstancesCall) Context(ctx context.Context) *RegionInstanceGroupManagersSuspendInstancesCall { c.ctx_ = ctx return c } // Header returns a http.Header that can be modified by the caller to add // headers to the request. -func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Header() http.Header { +func (c *RegionInstanceGroupManagersSuspendInstancesCall) Header() http.Header { if c.header_ == nil { c.header_ = make(http.Header) } return c.header_ } -func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { +func (c *RegionInstanceGroupManagersSuspendInstancesCall) doRequest(alt string) (*http.Response, error) { reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssettargetpoolsrequest) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regioninstancegroupmanagerssuspendinstancesrequest) if err != nil { return nil, err } c.urlParams_.Set("alt", alt) c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/suspendInstances") urls += "?" + c.urlParams_.Encode() req, err := http.NewRequest("POST", urls, body) if err != nil { @@ -9026,12 +10402,12 @@ func (c *RegionInstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (* return gensupport.SendRequest(c.ctx_, c.s.client, req) } -// Do executes the "compute.regionInstanceGroupManagers.setTargetPools" call. +// Do executes the "compute.regionInstanceGroupManagers.suspendInstances" call. // Any non-2xx status code is an error. Response headers are in either // *Operation.ServerResponse.Header or (if a response was returned at all) in // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check // whether the returned error was because http.StatusNotModified was returned. -func (c *RegionInstanceGroupManagersSetTargetPoolsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { +func (c *RegionInstanceGroupManagersSuspendInstancesCall) Do(opts ...googleapi.CallOption) (*Operation, error) { gensupport.SetOptions(c.urlParams_, opts...) res, err := c.doRequest("json") if res != nil && res.StatusCode == http.StatusNotModified { @@ -17077,6 +18453,131 @@ func (c *RegionSecurityPoliciesRemoveRuleCall) Do(opts ...googleapi.CallOption) return ret, nil } +type RegionSecurityPoliciesSetLabelsCall struct { + s *Service + project string + region string + resource string + regionsetlabelsrequest *RegionSetLabelsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context + header_ http.Header +} + +// SetLabels: Sets the labels on a security policy. To learn more about labels, +// read the Labeling Resources documentation. +// +// - project: Project ID for this request. +// - region: The region for this request. +// - resource: Name or id of the resource for this request. +func (r *RegionSecurityPoliciesService) SetLabels(project string, region string, resource string, regionsetlabelsrequest *RegionSetLabelsRequest) *RegionSecurityPoliciesSetLabelsCall { + c := &RegionSecurityPoliciesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.region = region + c.resource = resource + c.regionsetlabelsrequest = regionsetlabelsrequest + return c +} + +// RequestId sets the optional parameter "requestId": An optional request ID to +// identify requests. Specify a unique request ID so that if you must retry +// your request, the server will know to ignore the request if it has already +// been completed. For example, consider a situation where you make an initial +// request and the request times out. If you make the request again with the +// same request ID, the server can check if original operation with the same +// request ID was received, and if so, will ignore the second request. This +// prevents clients from accidentally creating duplicate commitments. The +// request ID must be a valid UUID with the exception that zero UUID is not +// supported ( 00000000-0000-0000-0000-000000000000). +func (c *RegionSecurityPoliciesSetLabelsCall) RequestId(requestId string) *RegionSecurityPoliciesSetLabelsCall { + c.urlParams_.Set("requestId", requestId) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *RegionSecurityPoliciesSetLabelsCall) Fields(s ...googleapi.Field) *RegionSecurityPoliciesSetLabelsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *RegionSecurityPoliciesSetLabelsCall) Context(ctx context.Context) *RegionSecurityPoliciesSetLabelsCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *RegionSecurityPoliciesSetLabelsCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *RegionSecurityPoliciesSetLabelsCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionsetlabelsrequest) + if err != nil { + return nil, err + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project}/regions/{region}/securityPolicies/{resource}/setLabels") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("POST", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "region": c.region, + "resource": c.resource, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "compute.regionSecurityPolicies.setLabels" call. +// Any non-2xx status code is an error. Response headers are in either +// *Operation.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was returned. +func (c *RegionSecurityPoliciesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type RegionSslCertificatesDeleteCall struct { s *Service project string diff --git a/vendor/google.golang.org/api/internal/version.go b/vendor/google.golang.org/api/internal/version.go index 7211ffe0305ae..ab745d712b915 100644 --- a/vendor/google.golang.org/api/internal/version.go +++ b/vendor/google.golang.org/api/internal/version.go @@ -5,4 +5,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.210.0" +const Version = "0.211.0" diff --git a/vendor/google.golang.org/api/transport/grpc/dial.go b/vendor/google.golang.org/api/transport/grpc/dial.go index 4015df6303d2c..95f4e7922d73e 100644 --- a/vendor/google.golang.org/api/transport/grpc/dial.go +++ b/vendor/google.golang.org/api/transport/grpc/dial.go @@ -22,7 +22,6 @@ import ( "cloud.google.com/go/auth/grpctransport" "cloud.google.com/go/auth/oauth2adapt" "cloud.google.com/go/compute/metadata" - "go.opencensus.io/plugin/ocgrpc" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "golang.org/x/oauth2" "golang.org/x/time/rate" @@ -385,7 +384,6 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C // Add tracing, but before the other options, so that clients can override the // gRPC stats handler. // This assumes that gRPC options are processed in order, left to right. - grpcOpts = addOCStatsHandler(grpcOpts, o) grpcOpts = addOpenTelemetryStatsHandler(grpcOpts, o) grpcOpts = append(grpcOpts, o.GRPCDialOpts...) if o.UserAgent != "" { @@ -395,13 +393,6 @@ func dial(ctx context.Context, insecure bool, o *internal.DialSettings) (*grpc.C return dialContext(ctx, endpoint, grpcOpts...) } -func addOCStatsHandler(opts []grpc.DialOption, settings *internal.DialSettings) []grpc.DialOption { - if settings.TelemetryDisabled { - return opts - } - return append(opts, grpc.WithStatsHandler(&ocgrpc.ClientHandler{})) -} - func addOpenTelemetryStatsHandler(opts []grpc.DialOption, settings *internal.DialSettings) []grpc.DialOption { if settings.TelemetryDisabled { return opts diff --git a/vendor/google.golang.org/api/transport/http/dial.go b/vendor/google.golang.org/api/transport/http/dial.go index d5b213e0f08df..6cdbac2ca1ea2 100644 --- a/vendor/google.golang.org/api/transport/http/dial.go +++ b/vendor/google.golang.org/api/transport/http/dial.go @@ -19,7 +19,6 @@ import ( "cloud.google.com/go/auth/credentials" "cloud.google.com/go/auth/httptransport" "cloud.google.com/go/auth/oauth2adapt" - "go.opencensus.io/plugin/ochttp" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "golang.org/x/net/http2" "golang.org/x/oauth2" @@ -27,7 +26,6 @@ import ( "google.golang.org/api/internal" "google.golang.org/api/internal/cert" "google.golang.org/api/option" - "google.golang.org/api/transport/http/internal/propagation" ) // NewClient returns an HTTP client for use communicating with a Google cloud @@ -165,10 +163,7 @@ func newTransport(ctx context.Context, base http.RoundTripper, settings *interna requestReason: settings.RequestReason, } var trans http.RoundTripper = paramTransport - // Give OpenTelemetry precedence over OpenCensus in case user configuration - // causes both to write the same header (`X-Cloud-Trace-Context`). trans = addOpenTelemetryTransport(trans, settings) - trans = addOCTransport(trans, settings) switch { case settings.NoAuth: // Do nothing. @@ -309,16 +304,6 @@ func addOpenTelemetryTransport(trans http.RoundTripper, settings *internal.DialS return otelhttp.NewTransport(trans) } -func addOCTransport(trans http.RoundTripper, settings *internal.DialSettings) http.RoundTripper { - if settings.TelemetryDisabled { - return trans - } - return &ochttp.Transport{ - Base: trans, - Propagation: &propagation.HTTPFormat{}, - } -} - // clonedTransport returns the given RoundTripper as a cloned *http.Transport. // It returns nil if the RoundTripper can't be cloned or coerced to // *http.Transport. diff --git a/vendor/google.golang.org/api/transport/http/internal/propagation/http.go b/vendor/google.golang.org/api/transport/http/internal/propagation/http.go deleted file mode 100644 index ba7512aa26d2e..0000000000000 --- a/vendor/google.golang.org/api/transport/http/internal/propagation/http.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2018 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.8 -// +build go1.8 - -// Package propagation implements X-Cloud-Trace-Context header propagation used -// by Google Cloud products. -package propagation - -import ( - "encoding/binary" - "encoding/hex" - "fmt" - "net/http" - "strconv" - "strings" - - "go.opencensus.io/trace" - "go.opencensus.io/trace/propagation" -) - -const ( - httpHeaderMaxSize = 200 - httpHeader = `X-Cloud-Trace-Context` -) - -var _ propagation.HTTPFormat = (*HTTPFormat)(nil) - -// HTTPFormat implements propagation.HTTPFormat to propagate -// traces in HTTP headers for Google Cloud Platform and Stackdriver Trace. -type HTTPFormat struct{} - -// SpanContextFromRequest extracts a Stackdriver Trace span context from incoming requests. -func (f *HTTPFormat) SpanContextFromRequest(req *http.Request) (sc trace.SpanContext, ok bool) { - h := req.Header.Get(httpHeader) - // See https://cloud.google.com/trace/docs/faq for the header HTTPFormat. - // Return if the header is empty or missing, or if the header is unreasonably - // large, to avoid making unnecessary copies of a large string. - if h == "" || len(h) > httpHeaderMaxSize { - return trace.SpanContext{}, false - } - - // Parse the trace id field. - slash := strings.Index(h, `/`) - if slash == -1 { - return trace.SpanContext{}, false - } - tid, h := h[:slash], h[slash+1:] - - buf, err := hex.DecodeString(tid) - if err != nil { - return trace.SpanContext{}, false - } - copy(sc.TraceID[:], buf) - - // Parse the span id field. - spanstr := h - semicolon := strings.Index(h, `;`) - if semicolon != -1 { - spanstr, h = h[:semicolon], h[semicolon+1:] - } - sid, err := strconv.ParseUint(spanstr, 10, 64) - if err != nil { - return trace.SpanContext{}, false - } - binary.BigEndian.PutUint64(sc.SpanID[:], sid) - - // Parse the options field, options field is optional. - if !strings.HasPrefix(h, "o=") { - return sc, true - } - o, err := strconv.ParseUint(h[2:], 10, 64) - if err != nil { - return trace.SpanContext{}, false - } - sc.TraceOptions = trace.TraceOptions(o) - return sc, true -} - -// SpanContextToRequest modifies the given request to include a Stackdriver Trace header. -func (f *HTTPFormat) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { - sid := binary.BigEndian.Uint64(sc.SpanID[:]) - header := fmt.Sprintf("%s/%d;o=%d", hex.EncodeToString(sc.TraceID[:]), sid, int64(sc.TraceOptions)) - req.Header.Set(httpHeader, header) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index c2e100287a4e5..31a913b3bb8ef 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -10,7 +10,7 @@ cloud.google.com/go/internal/optional cloud.google.com/go/internal/pubsub cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/auth v0.11.0 +# cloud.google.com/go/auth v0.12.1 ## explicit; go 1.21 cloud.google.com/go/auth cloud.google.com/go/auth/credentials @@ -1701,9 +1701,6 @@ go.opencensus.io/internal go.opencensus.io/internal/tagencoding go.opencensus.io/metric/metricdata go.opencensus.io/metric/metricproducer -go.opencensus.io/plugin/ocgrpc -go.opencensus.io/plugin/ochttp -go.opencensus.io/plugin/ochttp/propagation/b3 go.opencensus.io/resource go.opencensus.io/stats go.opencensus.io/stats/internal @@ -1711,7 +1708,6 @@ go.opencensus.io/stats/view go.opencensus.io/tag go.opencensus.io/trace go.opencensus.io/trace/internal -go.opencensus.io/trace/propagation go.opencensus.io/trace/tracestate # go.opentelemetry.io/collector/pdata v1.21.0 ## explicit; go 1.22.0 @@ -1934,7 +1930,7 @@ golang.org/x/tools/internal/stdlib golang.org/x/tools/internal/tokeninternal golang.org/x/tools/internal/typesinternal golang.org/x/tools/internal/versions -# google.golang.org/api v0.210.0 +# google.golang.org/api v0.211.0 ## explicit; go 1.21 google.golang.org/api/cloudresourcemanager/v1 google.golang.org/api/compute/v1 @@ -1954,14 +1950,13 @@ google.golang.org/api/support/bundler google.golang.org/api/transport google.golang.org/api/transport/grpc google.golang.org/api/transport/http -google.golang.org/api/transport/http/internal/propagation # google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 ## explicit; go 1.21 google.golang.org/genproto/googleapis/type/calendarperiod google.golang.org/genproto/googleapis/type/date google.golang.org/genproto/googleapis/type/expr google.golang.org/genproto/protobuf/api -# google.golang.org/genproto/googleapis/api v0.0.0-20241113202542-65e8d215514f +# google.golang.org/genproto/googleapis/api v0.0.0-20241118233622-e639e219e697 ## explicit; go 1.21 google.golang.org/genproto/googleapis/api google.golang.org/genproto/googleapis/api/annotations @@ -1970,7 +1965,7 @@ google.golang.org/genproto/googleapis/api/expr/v1alpha1 google.golang.org/genproto/googleapis/api/label google.golang.org/genproto/googleapis/api/metric google.golang.org/genproto/googleapis/api/monitoredres -# google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20241206012308-a4fef0638583 ## explicit; go 1.21 google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails