diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index ae1d1c2fde..26b0424a44 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -114,17 +114,21 @@ "Comment": "v0.0.2", "Rev": "66a23eaabc61518f91769939ff541886fe1dceef" }, + { + "ImportPath": "golang.org/x/crypto/curve25519", + "Rev": "beef0f4390813b96e8e68fd78570396d0f4751fc" + }, { "ImportPath": "golang.org/x/crypto/ssh", - "Rev": "1fbbd62cfec66bd39d91e97749579579d4d3037e" + "Rev": "beef0f4390813b96e8e68fd78570396d0f4751fc" }, { "ImportPath": "golang.org/x/net/context", - "Rev": "d9558e5c97f85372afee28cf2b6059d7d3818919" + "Rev": "4f2fc6c1e69d41baf187332ee08fbd2b296f21ed" }, { "ImportPath": "golang.org/x/oauth2", - "Rev": "038cb4adce85ed41e285c2e7cc6221a92bfa44aa" + "Rev": "442624c9ec9243441e83b374a9e22ac549b5c51d" }, { "ImportPath": "golang.org/x/sys/windows/registry", @@ -132,19 +136,23 @@ }, { "ImportPath": "google.golang.org/api/compute/v1", - "Rev": "a09229c13c2f13bbdedf7b31b506cad4c83ef3bf" + "Rev": "030d584ade5f79aa2ed0ce067e8f7da50c9a10d5" + }, + { + "ImportPath": "google.golang.org/api/gensupport", + "Rev": "030d584ade5f79aa2ed0ce067e8f7da50c9a10d5" }, { "ImportPath": "google.golang.org/api/googleapi", - "Rev": "a09229c13c2f13bbdedf7b31b506cad4c83ef3bf" + "Rev": "030d584ade5f79aa2ed0ce067e8f7da50c9a10d5" }, { "ImportPath": "google.golang.org/cloud/compute/metadata", - "Rev": "2400193c85c3561d13880d34e0e10c4315bb02af" + "Rev": "975617b05ea8a58727e6c1a06b6161ff4185a9f2" }, { "ImportPath": "google.golang.org/cloud/internal", - "Rev": "2400193c85c3561d13880d34e0e10c4315bb02af" + "Rev": "975617b05ea8a58727e6c1a06b6161ff4185a9f2" } ] } diff --git a/drivers/google/compute_util.go b/drivers/google/compute_util.go index c638f78e23..6346536494 100644 --- a/drivers/google/compute_util.go +++ b/drivers/google/compute_util.go @@ -261,13 +261,15 @@ func (c *ComputeUtil) createInstance(d *Driver) error { if err != nil { return err } + log.Infof("Uploading SSH Key") + metaDataValue := c.userName + ":" + string(sshKey) + "\n" op, err = c.service.Instances.SetMetadata(c.project, c.zone, c.instanceName, &raw.Metadata{ Fingerprint: instance.Metadata.Fingerprint, Items: []*raw.MetadataItems{ { Key: "sshKeys", - Value: c.userName + ":" + string(sshKey) + "\n", + Value: &metaDataValue, }, }, }).Do() diff --git a/vendor/golang.org/x/crypto/curve25519/const_amd64.s b/vendor/golang.org/x/crypto/curve25519/const_amd64.s new file mode 100644 index 0000000000..797f9b051d --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/const_amd64.s @@ -0,0 +1,20 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +// +build amd64,!gccgo,!appengine + +DATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF +GLOBL ·REDMASK51(SB), 8, $8 + +DATA ·_121666_213(SB)/8, $996687872 +GLOBL ·_121666_213(SB), 8, $8 + +DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA +GLOBL ·_2P0(SB), 8, $8 + +DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE +GLOBL ·_2P1234(SB), 8, $8 diff --git a/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s b/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s new file mode 100644 index 0000000000..45484d1b59 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s @@ -0,0 +1,88 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +// +build amd64,!gccgo,!appengine + +// func cswap(inout *[5]uint64, v uint64) +TEXT ·cswap(SB),7,$0 + MOVQ inout+0(FP),DI + MOVQ v+8(FP),SI + + CMPQ SI,$1 + MOVQ 0(DI),SI + MOVQ 80(DI),DX + MOVQ 8(DI),CX + MOVQ 88(DI),R8 + MOVQ SI,R9 + CMOVQEQ DX,SI + CMOVQEQ R9,DX + MOVQ CX,R9 + CMOVQEQ R8,CX + CMOVQEQ R9,R8 + MOVQ SI,0(DI) + MOVQ DX,80(DI) + MOVQ CX,8(DI) + MOVQ R8,88(DI) + MOVQ 16(DI),SI + MOVQ 96(DI),DX + MOVQ 24(DI),CX + MOVQ 104(DI),R8 + MOVQ SI,R9 + CMOVQEQ DX,SI + CMOVQEQ R9,DX + MOVQ CX,R9 + CMOVQEQ R8,CX + CMOVQEQ R9,R8 + MOVQ SI,16(DI) + MOVQ DX,96(DI) + MOVQ CX,24(DI) + MOVQ R8,104(DI) + MOVQ 32(DI),SI + MOVQ 112(DI),DX + MOVQ 40(DI),CX + MOVQ 120(DI),R8 + MOVQ SI,R9 + CMOVQEQ DX,SI + CMOVQEQ R9,DX + MOVQ CX,R9 + CMOVQEQ R8,CX + CMOVQEQ R9,R8 + MOVQ SI,32(DI) + MOVQ DX,112(DI) + MOVQ CX,40(DI) + MOVQ R8,120(DI) + MOVQ 48(DI),SI + MOVQ 128(DI),DX + MOVQ 56(DI),CX + MOVQ 136(DI),R8 + MOVQ SI,R9 + CMOVQEQ DX,SI + CMOVQEQ R9,DX + MOVQ CX,R9 + CMOVQEQ R8,CX + CMOVQEQ R9,R8 + MOVQ SI,48(DI) + MOVQ DX,128(DI) + MOVQ CX,56(DI) + MOVQ R8,136(DI) + MOVQ 64(DI),SI + MOVQ 144(DI),DX + MOVQ 72(DI),CX + MOVQ 152(DI),R8 + MOVQ SI,R9 + CMOVQEQ DX,SI + CMOVQEQ R9,DX + MOVQ CX,R9 + CMOVQEQ R8,CX + CMOVQEQ R9,R8 + MOVQ SI,64(DI) + MOVQ DX,144(DI) + MOVQ CX,72(DI) + MOVQ R8,152(DI) + MOVQ DI,AX + MOVQ SI,DX + RET diff --git a/vendor/golang.org/x/crypto/curve25519/curve25519.go b/vendor/golang.org/x/crypto/curve25519/curve25519.go new file mode 100644 index 0000000000..6918c47fc2 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/curve25519.go @@ -0,0 +1,841 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// We have a implementation in amd64 assembly so this code is only run on +// non-amd64 platforms. The amd64 assembly does not support gccgo. +// +build !amd64 gccgo appengine + +package curve25519 + +// This code is a port of the public domain, "ref10" implementation of +// curve25519 from SUPERCOP 20130419 by D. J. Bernstein. + +// fieldElement represents an element of the field GF(2^255 - 19). An element +// t, entries t[0]...t[9], represents the integer t[0]+2^26 t[1]+2^51 t[2]+2^77 +// t[3]+2^102 t[4]+...+2^230 t[9]. Bounds on each t[i] vary depending on +// context. +type fieldElement [10]int32 + +func feZero(fe *fieldElement) { + for i := range fe { + fe[i] = 0 + } +} + +func feOne(fe *fieldElement) { + feZero(fe) + fe[0] = 1 +} + +func feAdd(dst, a, b *fieldElement) { + for i := range dst { + dst[i] = a[i] + b[i] + } +} + +func feSub(dst, a, b *fieldElement) { + for i := range dst { + dst[i] = a[i] - b[i] + } +} + +func feCopy(dst, src *fieldElement) { + for i := range dst { + dst[i] = src[i] + } +} + +// feCSwap replaces (f,g) with (g,f) if b == 1; replaces (f,g) with (f,g) if b == 0. +// +// Preconditions: b in {0,1}. +func feCSwap(f, g *fieldElement, b int32) { + var x fieldElement + b = -b + for i := range x { + x[i] = b & (f[i] ^ g[i]) + } + + for i := range f { + f[i] ^= x[i] + } + for i := range g { + g[i] ^= x[i] + } +} + +// load3 reads a 24-bit, little-endian value from in. +func load3(in []byte) int64 { + var r int64 + r = int64(in[0]) + r |= int64(in[1]) << 8 + r |= int64(in[2]) << 16 + return r +} + +// load4 reads a 32-bit, little-endian value from in. +func load4(in []byte) int64 { + var r int64 + r = int64(in[0]) + r |= int64(in[1]) << 8 + r |= int64(in[2]) << 16 + r |= int64(in[3]) << 24 + return r +} + +func feFromBytes(dst *fieldElement, src *[32]byte) { + h0 := load4(src[:]) + h1 := load3(src[4:]) << 6 + h2 := load3(src[7:]) << 5 + h3 := load3(src[10:]) << 3 + h4 := load3(src[13:]) << 2 + h5 := load4(src[16:]) + h6 := load3(src[20:]) << 7 + h7 := load3(src[23:]) << 5 + h8 := load3(src[26:]) << 4 + h9 := load3(src[29:]) << 2 + + var carry [10]int64 + carry[9] = (h9 + 1<<24) >> 25 + h0 += carry[9] * 19 + h9 -= carry[9] << 25 + carry[1] = (h1 + 1<<24) >> 25 + h2 += carry[1] + h1 -= carry[1] << 25 + carry[3] = (h3 + 1<<24) >> 25 + h4 += carry[3] + h3 -= carry[3] << 25 + carry[5] = (h5 + 1<<24) >> 25 + h6 += carry[5] + h5 -= carry[5] << 25 + carry[7] = (h7 + 1<<24) >> 25 + h8 += carry[7] + h7 -= carry[7] << 25 + + carry[0] = (h0 + 1<<25) >> 26 + h1 += carry[0] + h0 -= carry[0] << 26 + carry[2] = (h2 + 1<<25) >> 26 + h3 += carry[2] + h2 -= carry[2] << 26 + carry[4] = (h4 + 1<<25) >> 26 + h5 += carry[4] + h4 -= carry[4] << 26 + carry[6] = (h6 + 1<<25) >> 26 + h7 += carry[6] + h6 -= carry[6] << 26 + carry[8] = (h8 + 1<<25) >> 26 + h9 += carry[8] + h8 -= carry[8] << 26 + + dst[0] = int32(h0) + dst[1] = int32(h1) + dst[2] = int32(h2) + dst[3] = int32(h3) + dst[4] = int32(h4) + dst[5] = int32(h5) + dst[6] = int32(h6) + dst[7] = int32(h7) + dst[8] = int32(h8) + dst[9] = int32(h9) +} + +// feToBytes marshals h to s. +// Preconditions: +// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. +// +// Write p=2^255-19; q=floor(h/p). +// Basic claim: q = floor(2^(-255)(h + 19 2^(-25)h9 + 2^(-1))). +// +// Proof: +// Have |h|<=p so |q|<=1 so |19^2 2^(-255) q|<1/4. +// Also have |h-2^230 h9|<2^230 so |19 2^(-255)(h-2^230 h9)|<1/4. +// +// Write y=2^(-1)-19^2 2^(-255)q-19 2^(-255)(h-2^230 h9). +// Then 0> 25 + q = (h[0] + q) >> 26 + q = (h[1] + q) >> 25 + q = (h[2] + q) >> 26 + q = (h[3] + q) >> 25 + q = (h[4] + q) >> 26 + q = (h[5] + q) >> 25 + q = (h[6] + q) >> 26 + q = (h[7] + q) >> 25 + q = (h[8] + q) >> 26 + q = (h[9] + q) >> 25 + + // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20. + h[0] += 19 * q + // Goal: Output h-2^255 q, which is between 0 and 2^255-20. + + carry[0] = h[0] >> 26 + h[1] += carry[0] + h[0] -= carry[0] << 26 + carry[1] = h[1] >> 25 + h[2] += carry[1] + h[1] -= carry[1] << 25 + carry[2] = h[2] >> 26 + h[3] += carry[2] + h[2] -= carry[2] << 26 + carry[3] = h[3] >> 25 + h[4] += carry[3] + h[3] -= carry[3] << 25 + carry[4] = h[4] >> 26 + h[5] += carry[4] + h[4] -= carry[4] << 26 + carry[5] = h[5] >> 25 + h[6] += carry[5] + h[5] -= carry[5] << 25 + carry[6] = h[6] >> 26 + h[7] += carry[6] + h[6] -= carry[6] << 26 + carry[7] = h[7] >> 25 + h[8] += carry[7] + h[7] -= carry[7] << 25 + carry[8] = h[8] >> 26 + h[9] += carry[8] + h[8] -= carry[8] << 26 + carry[9] = h[9] >> 25 + h[9] -= carry[9] << 25 + // h10 = carry9 + + // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20. + // Have h[0]+...+2^230 h[9] between 0 and 2^255-1; + // evidently 2^255 h10-2^255 q = 0. + // Goal: Output h[0]+...+2^230 h[9]. + + s[0] = byte(h[0] >> 0) + s[1] = byte(h[0] >> 8) + s[2] = byte(h[0] >> 16) + s[3] = byte((h[0] >> 24) | (h[1] << 2)) + s[4] = byte(h[1] >> 6) + s[5] = byte(h[1] >> 14) + s[6] = byte((h[1] >> 22) | (h[2] << 3)) + s[7] = byte(h[2] >> 5) + s[8] = byte(h[2] >> 13) + s[9] = byte((h[2] >> 21) | (h[3] << 5)) + s[10] = byte(h[3] >> 3) + s[11] = byte(h[3] >> 11) + s[12] = byte((h[3] >> 19) | (h[4] << 6)) + s[13] = byte(h[4] >> 2) + s[14] = byte(h[4] >> 10) + s[15] = byte(h[4] >> 18) + s[16] = byte(h[5] >> 0) + s[17] = byte(h[5] >> 8) + s[18] = byte(h[5] >> 16) + s[19] = byte((h[5] >> 24) | (h[6] << 1)) + s[20] = byte(h[6] >> 7) + s[21] = byte(h[6] >> 15) + s[22] = byte((h[6] >> 23) | (h[7] << 3)) + s[23] = byte(h[7] >> 5) + s[24] = byte(h[7] >> 13) + s[25] = byte((h[7] >> 21) | (h[8] << 4)) + s[26] = byte(h[8] >> 4) + s[27] = byte(h[8] >> 12) + s[28] = byte((h[8] >> 20) | (h[9] << 6)) + s[29] = byte(h[9] >> 2) + s[30] = byte(h[9] >> 10) + s[31] = byte(h[9] >> 18) +} + +// feMul calculates h = f * g +// Can overlap h with f or g. +// +// Preconditions: +// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +// |g| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +// +// Postconditions: +// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. +// +// Notes on implementation strategy: +// +// Using schoolbook multiplication. +// Karatsuba would save a little in some cost models. +// +// Most multiplications by 2 and 19 are 32-bit precomputations; +// cheaper than 64-bit postcomputations. +// +// There is one remaining multiplication by 19 in the carry chain; +// one *19 precomputation can be merged into this, +// but the resulting data flow is considerably less clean. +// +// There are 12 carries below. +// 10 of them are 2-way parallelizable and vectorizable. +// Can get away with 11 carries, but then data flow is much deeper. +// +// With tighter constraints on inputs can squeeze carries into int32. +func feMul(h, f, g *fieldElement) { + f0 := f[0] + f1 := f[1] + f2 := f[2] + f3 := f[3] + f4 := f[4] + f5 := f[5] + f6 := f[6] + f7 := f[7] + f8 := f[8] + f9 := f[9] + g0 := g[0] + g1 := g[1] + g2 := g[2] + g3 := g[3] + g4 := g[4] + g5 := g[5] + g6 := g[6] + g7 := g[7] + g8 := g[8] + g9 := g[9] + g1_19 := 19 * g1 // 1.4*2^29 + g2_19 := 19 * g2 // 1.4*2^30; still ok + g3_19 := 19 * g3 + g4_19 := 19 * g4 + g5_19 := 19 * g5 + g6_19 := 19 * g6 + g7_19 := 19 * g7 + g8_19 := 19 * g8 + g9_19 := 19 * g9 + f1_2 := 2 * f1 + f3_2 := 2 * f3 + f5_2 := 2 * f5 + f7_2 := 2 * f7 + f9_2 := 2 * f9 + f0g0 := int64(f0) * int64(g0) + f0g1 := int64(f0) * int64(g1) + f0g2 := int64(f0) * int64(g2) + f0g3 := int64(f0) * int64(g3) + f0g4 := int64(f0) * int64(g4) + f0g5 := int64(f0) * int64(g5) + f0g6 := int64(f0) * int64(g6) + f0g7 := int64(f0) * int64(g7) + f0g8 := int64(f0) * int64(g8) + f0g9 := int64(f0) * int64(g9) + f1g0 := int64(f1) * int64(g0) + f1g1_2 := int64(f1_2) * int64(g1) + f1g2 := int64(f1) * int64(g2) + f1g3_2 := int64(f1_2) * int64(g3) + f1g4 := int64(f1) * int64(g4) + f1g5_2 := int64(f1_2) * int64(g5) + f1g6 := int64(f1) * int64(g6) + f1g7_2 := int64(f1_2) * int64(g7) + f1g8 := int64(f1) * int64(g8) + f1g9_38 := int64(f1_2) * int64(g9_19) + f2g0 := int64(f2) * int64(g0) + f2g1 := int64(f2) * int64(g1) + f2g2 := int64(f2) * int64(g2) + f2g3 := int64(f2) * int64(g3) + f2g4 := int64(f2) * int64(g4) + f2g5 := int64(f2) * int64(g5) + f2g6 := int64(f2) * int64(g6) + f2g7 := int64(f2) * int64(g7) + f2g8_19 := int64(f2) * int64(g8_19) + f2g9_19 := int64(f2) * int64(g9_19) + f3g0 := int64(f3) * int64(g0) + f3g1_2 := int64(f3_2) * int64(g1) + f3g2 := int64(f3) * int64(g2) + f3g3_2 := int64(f3_2) * int64(g3) + f3g4 := int64(f3) * int64(g4) + f3g5_2 := int64(f3_2) * int64(g5) + f3g6 := int64(f3) * int64(g6) + f3g7_38 := int64(f3_2) * int64(g7_19) + f3g8_19 := int64(f3) * int64(g8_19) + f3g9_38 := int64(f3_2) * int64(g9_19) + f4g0 := int64(f4) * int64(g0) + f4g1 := int64(f4) * int64(g1) + f4g2 := int64(f4) * int64(g2) + f4g3 := int64(f4) * int64(g3) + f4g4 := int64(f4) * int64(g4) + f4g5 := int64(f4) * int64(g5) + f4g6_19 := int64(f4) * int64(g6_19) + f4g7_19 := int64(f4) * int64(g7_19) + f4g8_19 := int64(f4) * int64(g8_19) + f4g9_19 := int64(f4) * int64(g9_19) + f5g0 := int64(f5) * int64(g0) + f5g1_2 := int64(f5_2) * int64(g1) + f5g2 := int64(f5) * int64(g2) + f5g3_2 := int64(f5_2) * int64(g3) + f5g4 := int64(f5) * int64(g4) + f5g5_38 := int64(f5_2) * int64(g5_19) + f5g6_19 := int64(f5) * int64(g6_19) + f5g7_38 := int64(f5_2) * int64(g7_19) + f5g8_19 := int64(f5) * int64(g8_19) + f5g9_38 := int64(f5_2) * int64(g9_19) + f6g0 := int64(f6) * int64(g0) + f6g1 := int64(f6) * int64(g1) + f6g2 := int64(f6) * int64(g2) + f6g3 := int64(f6) * int64(g3) + f6g4_19 := int64(f6) * int64(g4_19) + f6g5_19 := int64(f6) * int64(g5_19) + f6g6_19 := int64(f6) * int64(g6_19) + f6g7_19 := int64(f6) * int64(g7_19) + f6g8_19 := int64(f6) * int64(g8_19) + f6g9_19 := int64(f6) * int64(g9_19) + f7g0 := int64(f7) * int64(g0) + f7g1_2 := int64(f7_2) * int64(g1) + f7g2 := int64(f7) * int64(g2) + f7g3_38 := int64(f7_2) * int64(g3_19) + f7g4_19 := int64(f7) * int64(g4_19) + f7g5_38 := int64(f7_2) * int64(g5_19) + f7g6_19 := int64(f7) * int64(g6_19) + f7g7_38 := int64(f7_2) * int64(g7_19) + f7g8_19 := int64(f7) * int64(g8_19) + f7g9_38 := int64(f7_2) * int64(g9_19) + f8g0 := int64(f8) * int64(g0) + f8g1 := int64(f8) * int64(g1) + f8g2_19 := int64(f8) * int64(g2_19) + f8g3_19 := int64(f8) * int64(g3_19) + f8g4_19 := int64(f8) * int64(g4_19) + f8g5_19 := int64(f8) * int64(g5_19) + f8g6_19 := int64(f8) * int64(g6_19) + f8g7_19 := int64(f8) * int64(g7_19) + f8g8_19 := int64(f8) * int64(g8_19) + f8g9_19 := int64(f8) * int64(g9_19) + f9g0 := int64(f9) * int64(g0) + f9g1_38 := int64(f9_2) * int64(g1_19) + f9g2_19 := int64(f9) * int64(g2_19) + f9g3_38 := int64(f9_2) * int64(g3_19) + f9g4_19 := int64(f9) * int64(g4_19) + f9g5_38 := int64(f9_2) * int64(g5_19) + f9g6_19 := int64(f9) * int64(g6_19) + f9g7_38 := int64(f9_2) * int64(g7_19) + f9g8_19 := int64(f9) * int64(g8_19) + f9g9_38 := int64(f9_2) * int64(g9_19) + h0 := f0g0 + f1g9_38 + f2g8_19 + f3g7_38 + f4g6_19 + f5g5_38 + f6g4_19 + f7g3_38 + f8g2_19 + f9g1_38 + h1 := f0g1 + f1g0 + f2g9_19 + f3g8_19 + f4g7_19 + f5g6_19 + f6g5_19 + f7g4_19 + f8g3_19 + f9g2_19 + h2 := f0g2 + f1g1_2 + f2g0 + f3g9_38 + f4g8_19 + f5g7_38 + f6g6_19 + f7g5_38 + f8g4_19 + f9g3_38 + h3 := f0g3 + f1g2 + f2g1 + f3g0 + f4g9_19 + f5g8_19 + f6g7_19 + f7g6_19 + f8g5_19 + f9g4_19 + h4 := f0g4 + f1g3_2 + f2g2 + f3g1_2 + f4g0 + f5g9_38 + f6g8_19 + f7g7_38 + f8g6_19 + f9g5_38 + h5 := f0g5 + f1g4 + f2g3 + f3g2 + f4g1 + f5g0 + f6g9_19 + f7g8_19 + f8g7_19 + f9g6_19 + h6 := f0g6 + f1g5_2 + f2g4 + f3g3_2 + f4g2 + f5g1_2 + f6g0 + f7g9_38 + f8g8_19 + f9g7_38 + h7 := f0g7 + f1g6 + f2g5 + f3g4 + f4g3 + f5g2 + f6g1 + f7g0 + f8g9_19 + f9g8_19 + h8 := f0g8 + f1g7_2 + f2g6 + f3g5_2 + f4g4 + f5g3_2 + f6g2 + f7g1_2 + f8g0 + f9g9_38 + h9 := f0g9 + f1g8 + f2g7 + f3g6 + f4g5 + f5g4 + f6g3 + f7g2 + f8g1 + f9g0 + var carry [10]int64 + + // |h0| <= (1.1*1.1*2^52*(1+19+19+19+19)+1.1*1.1*2^50*(38+38+38+38+38)) + // i.e. |h0| <= 1.2*2^59; narrower ranges for h2, h4, h6, h8 + // |h1| <= (1.1*1.1*2^51*(1+1+19+19+19+19+19+19+19+19)) + // i.e. |h1| <= 1.5*2^58; narrower ranges for h3, h5, h7, h9 + + carry[0] = (h0 + (1 << 25)) >> 26 + h1 += carry[0] + h0 -= carry[0] << 26 + carry[4] = (h4 + (1 << 25)) >> 26 + h5 += carry[4] + h4 -= carry[4] << 26 + // |h0| <= 2^25 + // |h4| <= 2^25 + // |h1| <= 1.51*2^58 + // |h5| <= 1.51*2^58 + + carry[1] = (h1 + (1 << 24)) >> 25 + h2 += carry[1] + h1 -= carry[1] << 25 + carry[5] = (h5 + (1 << 24)) >> 25 + h6 += carry[5] + h5 -= carry[5] << 25 + // |h1| <= 2^24; from now on fits into int32 + // |h5| <= 2^24; from now on fits into int32 + // |h2| <= 1.21*2^59 + // |h6| <= 1.21*2^59 + + carry[2] = (h2 + (1 << 25)) >> 26 + h3 += carry[2] + h2 -= carry[2] << 26 + carry[6] = (h6 + (1 << 25)) >> 26 + h7 += carry[6] + h6 -= carry[6] << 26 + // |h2| <= 2^25; from now on fits into int32 unchanged + // |h6| <= 2^25; from now on fits into int32 unchanged + // |h3| <= 1.51*2^58 + // |h7| <= 1.51*2^58 + + carry[3] = (h3 + (1 << 24)) >> 25 + h4 += carry[3] + h3 -= carry[3] << 25 + carry[7] = (h7 + (1 << 24)) >> 25 + h8 += carry[7] + h7 -= carry[7] << 25 + // |h3| <= 2^24; from now on fits into int32 unchanged + // |h7| <= 2^24; from now on fits into int32 unchanged + // |h4| <= 1.52*2^33 + // |h8| <= 1.52*2^33 + + carry[4] = (h4 + (1 << 25)) >> 26 + h5 += carry[4] + h4 -= carry[4] << 26 + carry[8] = (h8 + (1 << 25)) >> 26 + h9 += carry[8] + h8 -= carry[8] << 26 + // |h4| <= 2^25; from now on fits into int32 unchanged + // |h8| <= 2^25; from now on fits into int32 unchanged + // |h5| <= 1.01*2^24 + // |h9| <= 1.51*2^58 + + carry[9] = (h9 + (1 << 24)) >> 25 + h0 += carry[9] * 19 + h9 -= carry[9] << 25 + // |h9| <= 2^24; from now on fits into int32 unchanged + // |h0| <= 1.8*2^37 + + carry[0] = (h0 + (1 << 25)) >> 26 + h1 += carry[0] + h0 -= carry[0] << 26 + // |h0| <= 2^25; from now on fits into int32 unchanged + // |h1| <= 1.01*2^24 + + h[0] = int32(h0) + h[1] = int32(h1) + h[2] = int32(h2) + h[3] = int32(h3) + h[4] = int32(h4) + h[5] = int32(h5) + h[6] = int32(h6) + h[7] = int32(h7) + h[8] = int32(h8) + h[9] = int32(h9) +} + +// feSquare calculates h = f*f. Can overlap h with f. +// +// Preconditions: +// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +// +// Postconditions: +// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. +func feSquare(h, f *fieldElement) { + f0 := f[0] + f1 := f[1] + f2 := f[2] + f3 := f[3] + f4 := f[4] + f5 := f[5] + f6 := f[6] + f7 := f[7] + f8 := f[8] + f9 := f[9] + f0_2 := 2 * f0 + f1_2 := 2 * f1 + f2_2 := 2 * f2 + f3_2 := 2 * f3 + f4_2 := 2 * f4 + f5_2 := 2 * f5 + f6_2 := 2 * f6 + f7_2 := 2 * f7 + f5_38 := 38 * f5 // 1.31*2^30 + f6_19 := 19 * f6 // 1.31*2^30 + f7_38 := 38 * f7 // 1.31*2^30 + f8_19 := 19 * f8 // 1.31*2^30 + f9_38 := 38 * f9 // 1.31*2^30 + f0f0 := int64(f0) * int64(f0) + f0f1_2 := int64(f0_2) * int64(f1) + f0f2_2 := int64(f0_2) * int64(f2) + f0f3_2 := int64(f0_2) * int64(f3) + f0f4_2 := int64(f0_2) * int64(f4) + f0f5_2 := int64(f0_2) * int64(f5) + f0f6_2 := int64(f0_2) * int64(f6) + f0f7_2 := int64(f0_2) * int64(f7) + f0f8_2 := int64(f0_2) * int64(f8) + f0f9_2 := int64(f0_2) * int64(f9) + f1f1_2 := int64(f1_2) * int64(f1) + f1f2_2 := int64(f1_2) * int64(f2) + f1f3_4 := int64(f1_2) * int64(f3_2) + f1f4_2 := int64(f1_2) * int64(f4) + f1f5_4 := int64(f1_2) * int64(f5_2) + f1f6_2 := int64(f1_2) * int64(f6) + f1f7_4 := int64(f1_2) * int64(f7_2) + f1f8_2 := int64(f1_2) * int64(f8) + f1f9_76 := int64(f1_2) * int64(f9_38) + f2f2 := int64(f2) * int64(f2) + f2f3_2 := int64(f2_2) * int64(f3) + f2f4_2 := int64(f2_2) * int64(f4) + f2f5_2 := int64(f2_2) * int64(f5) + f2f6_2 := int64(f2_2) * int64(f6) + f2f7_2 := int64(f2_2) * int64(f7) + f2f8_38 := int64(f2_2) * int64(f8_19) + f2f9_38 := int64(f2) * int64(f9_38) + f3f3_2 := int64(f3_2) * int64(f3) + f3f4_2 := int64(f3_2) * int64(f4) + f3f5_4 := int64(f3_2) * int64(f5_2) + f3f6_2 := int64(f3_2) * int64(f6) + f3f7_76 := int64(f3_2) * int64(f7_38) + f3f8_38 := int64(f3_2) * int64(f8_19) + f3f9_76 := int64(f3_2) * int64(f9_38) + f4f4 := int64(f4) * int64(f4) + f4f5_2 := int64(f4_2) * int64(f5) + f4f6_38 := int64(f4_2) * int64(f6_19) + f4f7_38 := int64(f4) * int64(f7_38) + f4f8_38 := int64(f4_2) * int64(f8_19) + f4f9_38 := int64(f4) * int64(f9_38) + f5f5_38 := int64(f5) * int64(f5_38) + f5f6_38 := int64(f5_2) * int64(f6_19) + f5f7_76 := int64(f5_2) * int64(f7_38) + f5f8_38 := int64(f5_2) * int64(f8_19) + f5f9_76 := int64(f5_2) * int64(f9_38) + f6f6_19 := int64(f6) * int64(f6_19) + f6f7_38 := int64(f6) * int64(f7_38) + f6f8_38 := int64(f6_2) * int64(f8_19) + f6f9_38 := int64(f6) * int64(f9_38) + f7f7_38 := int64(f7) * int64(f7_38) + f7f8_38 := int64(f7_2) * int64(f8_19) + f7f9_76 := int64(f7_2) * int64(f9_38) + f8f8_19 := int64(f8) * int64(f8_19) + f8f9_38 := int64(f8) * int64(f9_38) + f9f9_38 := int64(f9) * int64(f9_38) + h0 := f0f0 + f1f9_76 + f2f8_38 + f3f7_76 + f4f6_38 + f5f5_38 + h1 := f0f1_2 + f2f9_38 + f3f8_38 + f4f7_38 + f5f6_38 + h2 := f0f2_2 + f1f1_2 + f3f9_76 + f4f8_38 + f5f7_76 + f6f6_19 + h3 := f0f3_2 + f1f2_2 + f4f9_38 + f5f8_38 + f6f7_38 + h4 := f0f4_2 + f1f3_4 + f2f2 + f5f9_76 + f6f8_38 + f7f7_38 + h5 := f0f5_2 + f1f4_2 + f2f3_2 + f6f9_38 + f7f8_38 + h6 := f0f6_2 + f1f5_4 + f2f4_2 + f3f3_2 + f7f9_76 + f8f8_19 + h7 := f0f7_2 + f1f6_2 + f2f5_2 + f3f4_2 + f8f9_38 + h8 := f0f8_2 + f1f7_4 + f2f6_2 + f3f5_4 + f4f4 + f9f9_38 + h9 := f0f9_2 + f1f8_2 + f2f7_2 + f3f6_2 + f4f5_2 + var carry [10]int64 + + carry[0] = (h0 + (1 << 25)) >> 26 + h1 += carry[0] + h0 -= carry[0] << 26 + carry[4] = (h4 + (1 << 25)) >> 26 + h5 += carry[4] + h4 -= carry[4] << 26 + + carry[1] = (h1 + (1 << 24)) >> 25 + h2 += carry[1] + h1 -= carry[1] << 25 + carry[5] = (h5 + (1 << 24)) >> 25 + h6 += carry[5] + h5 -= carry[5] << 25 + + carry[2] = (h2 + (1 << 25)) >> 26 + h3 += carry[2] + h2 -= carry[2] << 26 + carry[6] = (h6 + (1 << 25)) >> 26 + h7 += carry[6] + h6 -= carry[6] << 26 + + carry[3] = (h3 + (1 << 24)) >> 25 + h4 += carry[3] + h3 -= carry[3] << 25 + carry[7] = (h7 + (1 << 24)) >> 25 + h8 += carry[7] + h7 -= carry[7] << 25 + + carry[4] = (h4 + (1 << 25)) >> 26 + h5 += carry[4] + h4 -= carry[4] << 26 + carry[8] = (h8 + (1 << 25)) >> 26 + h9 += carry[8] + h8 -= carry[8] << 26 + + carry[9] = (h9 + (1 << 24)) >> 25 + h0 += carry[9] * 19 + h9 -= carry[9] << 25 + + carry[0] = (h0 + (1 << 25)) >> 26 + h1 += carry[0] + h0 -= carry[0] << 26 + + h[0] = int32(h0) + h[1] = int32(h1) + h[2] = int32(h2) + h[3] = int32(h3) + h[4] = int32(h4) + h[5] = int32(h5) + h[6] = int32(h6) + h[7] = int32(h7) + h[8] = int32(h8) + h[9] = int32(h9) +} + +// feMul121666 calculates h = f * 121666. Can overlap h with f. +// +// Preconditions: +// |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. +// +// Postconditions: +// |h| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. +func feMul121666(h, f *fieldElement) { + h0 := int64(f[0]) * 121666 + h1 := int64(f[1]) * 121666 + h2 := int64(f[2]) * 121666 + h3 := int64(f[3]) * 121666 + h4 := int64(f[4]) * 121666 + h5 := int64(f[5]) * 121666 + h6 := int64(f[6]) * 121666 + h7 := int64(f[7]) * 121666 + h8 := int64(f[8]) * 121666 + h9 := int64(f[9]) * 121666 + var carry [10]int64 + + carry[9] = (h9 + (1 << 24)) >> 25 + h0 += carry[9] * 19 + h9 -= carry[9] << 25 + carry[1] = (h1 + (1 << 24)) >> 25 + h2 += carry[1] + h1 -= carry[1] << 25 + carry[3] = (h3 + (1 << 24)) >> 25 + h4 += carry[3] + h3 -= carry[3] << 25 + carry[5] = (h5 + (1 << 24)) >> 25 + h6 += carry[5] + h5 -= carry[5] << 25 + carry[7] = (h7 + (1 << 24)) >> 25 + h8 += carry[7] + h7 -= carry[7] << 25 + + carry[0] = (h0 + (1 << 25)) >> 26 + h1 += carry[0] + h0 -= carry[0] << 26 + carry[2] = (h2 + (1 << 25)) >> 26 + h3 += carry[2] + h2 -= carry[2] << 26 + carry[4] = (h4 + (1 << 25)) >> 26 + h5 += carry[4] + h4 -= carry[4] << 26 + carry[6] = (h6 + (1 << 25)) >> 26 + h7 += carry[6] + h6 -= carry[6] << 26 + carry[8] = (h8 + (1 << 25)) >> 26 + h9 += carry[8] + h8 -= carry[8] << 26 + + h[0] = int32(h0) + h[1] = int32(h1) + h[2] = int32(h2) + h[3] = int32(h3) + h[4] = int32(h4) + h[5] = int32(h5) + h[6] = int32(h6) + h[7] = int32(h7) + h[8] = int32(h8) + h[9] = int32(h9) +} + +// feInvert sets out = z^-1. +func feInvert(out, z *fieldElement) { + var t0, t1, t2, t3 fieldElement + var i int + + feSquare(&t0, z) + for i = 1; i < 1; i++ { + feSquare(&t0, &t0) + } + feSquare(&t1, &t0) + for i = 1; i < 2; i++ { + feSquare(&t1, &t1) + } + feMul(&t1, z, &t1) + feMul(&t0, &t0, &t1) + feSquare(&t2, &t0) + for i = 1; i < 1; i++ { + feSquare(&t2, &t2) + } + feMul(&t1, &t1, &t2) + feSquare(&t2, &t1) + for i = 1; i < 5; i++ { + feSquare(&t2, &t2) + } + feMul(&t1, &t2, &t1) + feSquare(&t2, &t1) + for i = 1; i < 10; i++ { + feSquare(&t2, &t2) + } + feMul(&t2, &t2, &t1) + feSquare(&t3, &t2) + for i = 1; i < 20; i++ { + feSquare(&t3, &t3) + } + feMul(&t2, &t3, &t2) + feSquare(&t2, &t2) + for i = 1; i < 10; i++ { + feSquare(&t2, &t2) + } + feMul(&t1, &t2, &t1) + feSquare(&t2, &t1) + for i = 1; i < 50; i++ { + feSquare(&t2, &t2) + } + feMul(&t2, &t2, &t1) + feSquare(&t3, &t2) + for i = 1; i < 100; i++ { + feSquare(&t3, &t3) + } + feMul(&t2, &t3, &t2) + feSquare(&t2, &t2) + for i = 1; i < 50; i++ { + feSquare(&t2, &t2) + } + feMul(&t1, &t2, &t1) + feSquare(&t1, &t1) + for i = 1; i < 5; i++ { + feSquare(&t1, &t1) + } + feMul(out, &t1, &t0) +} + +func scalarMult(out, in, base *[32]byte) { + var e [32]byte + + copy(e[:], in[:]) + e[0] &= 248 + e[31] &= 127 + e[31] |= 64 + + var x1, x2, z2, x3, z3, tmp0, tmp1 fieldElement + feFromBytes(&x1, base) + feOne(&x2) + feCopy(&x3, &x1) + feOne(&z3) + + swap := int32(0) + for pos := 254; pos >= 0; pos-- { + b := e[pos/8] >> uint(pos&7) + b &= 1 + swap ^= int32(b) + feCSwap(&x2, &x3, swap) + feCSwap(&z2, &z3, swap) + swap = int32(b) + + feSub(&tmp0, &x3, &z3) + feSub(&tmp1, &x2, &z2) + feAdd(&x2, &x2, &z2) + feAdd(&z2, &x3, &z3) + feMul(&z3, &tmp0, &x2) + feMul(&z2, &z2, &tmp1) + feSquare(&tmp0, &tmp1) + feSquare(&tmp1, &x2) + feAdd(&x3, &z3, &z2) + feSub(&z2, &z3, &z2) + feMul(&x2, &tmp1, &tmp0) + feSub(&tmp1, &tmp1, &tmp0) + feSquare(&z2, &z2) + feMul121666(&z3, &tmp1) + feSquare(&x3, &x3) + feAdd(&tmp0, &tmp0, &z3) + feMul(&z3, &x1, &z2) + feMul(&z2, &tmp1, &tmp0) + } + + feCSwap(&x2, &x3, swap) + feCSwap(&z2, &z3, swap) + + feInvert(&z2, &z2) + feMul(&x2, &x2, &z2) + feToBytes(out, &x2) +} diff --git a/vendor/golang.org/x/crypto/curve25519/doc.go b/vendor/golang.org/x/crypto/curve25519/doc.go new file mode 100644 index 0000000000..f7db9c1ce8 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/doc.go @@ -0,0 +1,23 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package curve25519 provides an implementation of scalar multiplication on +// the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html +package curve25519 + +// basePoint is the x coordinate of the generator of the curve. +var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + +// ScalarMult sets dst to the product in*base where dst and base are the x +// coordinates of group points and all values are in little-endian form. +func ScalarMult(dst, in, base *[32]byte) { + scalarMult(dst, in, base) +} + +// ScalarBaseMult sets dst to the product in*base where dst and base are the x +// coordinates of group points, base is the standard generator and all values +// are in little-endian form. +func ScalarBaseMult(dst, in *[32]byte) { + ScalarMult(dst, in, &basePoint) +} diff --git a/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s b/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s new file mode 100644 index 0000000000..37599fac04 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s @@ -0,0 +1,94 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +// +build amd64,!gccgo,!appengine + +// func freeze(inout *[5]uint64) +TEXT ·freeze(SB),7,$96-8 + MOVQ inout+0(FP), DI + + MOVQ SP,R11 + MOVQ $31,CX + NOTQ CX + ANDQ CX,SP + ADDQ $32,SP + + MOVQ R11,0(SP) + MOVQ R12,8(SP) + MOVQ R13,16(SP) + MOVQ R14,24(SP) + MOVQ R15,32(SP) + MOVQ BX,40(SP) + MOVQ BP,48(SP) + MOVQ 0(DI),SI + MOVQ 8(DI),DX + MOVQ 16(DI),CX + MOVQ 24(DI),R8 + MOVQ 32(DI),R9 + MOVQ ·REDMASK51(SB),AX + MOVQ AX,R10 + SUBQ $18,R10 + MOVQ $3,R11 +REDUCELOOP: + MOVQ SI,R12 + SHRQ $51,R12 + ANDQ AX,SI + ADDQ R12,DX + MOVQ DX,R12 + SHRQ $51,R12 + ANDQ AX,DX + ADDQ R12,CX + MOVQ CX,R12 + SHRQ $51,R12 + ANDQ AX,CX + ADDQ R12,R8 + MOVQ R8,R12 + SHRQ $51,R12 + ANDQ AX,R8 + ADDQ R12,R9 + MOVQ R9,R12 + SHRQ $51,R12 + ANDQ AX,R9 + IMUL3Q $19,R12,R12 + ADDQ R12,SI + SUBQ $1,R11 + JA REDUCELOOP + MOVQ $1,R12 + CMPQ R10,SI + CMOVQLT R11,R12 + CMPQ AX,DX + CMOVQNE R11,R12 + CMPQ AX,CX + CMOVQNE R11,R12 + CMPQ AX,R8 + CMOVQNE R11,R12 + CMPQ AX,R9 + CMOVQNE R11,R12 + NEGQ R12 + ANDQ R12,AX + ANDQ R12,R10 + SUBQ R10,SI + SUBQ AX,DX + SUBQ AX,CX + SUBQ AX,R8 + SUBQ AX,R9 + MOVQ SI,0(DI) + MOVQ DX,8(DI) + MOVQ CX,16(DI) + MOVQ R8,24(DI) + MOVQ R9,32(DI) + MOVQ 0(SP),R11 + MOVQ 8(SP),R12 + MOVQ 16(SP),R13 + MOVQ 24(SP),R14 + MOVQ 32(SP),R15 + MOVQ 40(SP),BX + MOVQ 48(SP),BP + MOVQ R11,SP + MOVQ DI,AX + MOVQ SI,DX + RET diff --git a/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s b/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s new file mode 100644 index 0000000000..3949f9cfaf --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/ladderstep_amd64.s @@ -0,0 +1,1398 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +// +build amd64,!gccgo,!appengine + +// func ladderstep(inout *[5][5]uint64) +TEXT ·ladderstep(SB),0,$384-8 + MOVQ inout+0(FP),DI + + MOVQ SP,R11 + MOVQ $31,CX + NOTQ CX + ANDQ CX,SP + ADDQ $32,SP + + MOVQ R11,0(SP) + MOVQ R12,8(SP) + MOVQ R13,16(SP) + MOVQ R14,24(SP) + MOVQ R15,32(SP) + MOVQ BX,40(SP) + MOVQ BP,48(SP) + MOVQ 40(DI),SI + MOVQ 48(DI),DX + MOVQ 56(DI),CX + MOVQ 64(DI),R8 + MOVQ 72(DI),R9 + MOVQ SI,AX + MOVQ DX,R10 + MOVQ CX,R11 + MOVQ R8,R12 + MOVQ R9,R13 + ADDQ ·_2P0(SB),AX + ADDQ ·_2P1234(SB),R10 + ADDQ ·_2P1234(SB),R11 + ADDQ ·_2P1234(SB),R12 + ADDQ ·_2P1234(SB),R13 + ADDQ 80(DI),SI + ADDQ 88(DI),DX + ADDQ 96(DI),CX + ADDQ 104(DI),R8 + ADDQ 112(DI),R9 + SUBQ 80(DI),AX + SUBQ 88(DI),R10 + SUBQ 96(DI),R11 + SUBQ 104(DI),R12 + SUBQ 112(DI),R13 + MOVQ SI,56(SP) + MOVQ DX,64(SP) + MOVQ CX,72(SP) + MOVQ R8,80(SP) + MOVQ R9,88(SP) + MOVQ AX,96(SP) + MOVQ R10,104(SP) + MOVQ R11,112(SP) + MOVQ R12,120(SP) + MOVQ R13,128(SP) + MOVQ 96(SP),AX + MULQ 96(SP) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 96(SP),AX + SHLQ $1,AX + MULQ 104(SP) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 96(SP),AX + SHLQ $1,AX + MULQ 112(SP) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 96(SP),AX + SHLQ $1,AX + MULQ 120(SP) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 96(SP),AX + SHLQ $1,AX + MULQ 128(SP) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 104(SP),AX + MULQ 104(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 104(SP),AX + SHLQ $1,AX + MULQ 112(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 104(SP),AX + SHLQ $1,AX + MULQ 120(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 104(SP),DX + IMUL3Q $38,DX,AX + MULQ 128(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 112(SP),AX + MULQ 112(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 112(SP),DX + IMUL3Q $38,DX,AX + MULQ 120(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 112(SP),DX + IMUL3Q $38,DX,AX + MULQ 128(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 120(SP),DX + IMUL3Q $19,DX,AX + MULQ 120(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 120(SP),DX + IMUL3Q $38,DX,AX + MULQ 128(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 128(SP),DX + IMUL3Q $19,DX,AX + MULQ 128(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + ANDQ DX,SI + MOVQ CX,R8 + SHRQ $51,CX + ADDQ R10,CX + ANDQ DX,R8 + MOVQ CX,R9 + SHRQ $51,CX + ADDQ R12,CX + ANDQ DX,R9 + MOVQ CX,AX + SHRQ $51,CX + ADDQ R14,CX + ANDQ DX,AX + MOVQ CX,R10 + SHRQ $51,CX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,136(SP) + MOVQ R8,144(SP) + MOVQ R9,152(SP) + MOVQ AX,160(SP) + MOVQ R10,168(SP) + MOVQ 56(SP),AX + MULQ 56(SP) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 56(SP),AX + SHLQ $1,AX + MULQ 64(SP) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 56(SP),AX + SHLQ $1,AX + MULQ 72(SP) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 56(SP),AX + SHLQ $1,AX + MULQ 80(SP) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 56(SP),AX + SHLQ $1,AX + MULQ 88(SP) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 64(SP),AX + MULQ 64(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 64(SP),AX + SHLQ $1,AX + MULQ 72(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 64(SP),AX + SHLQ $1,AX + MULQ 80(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 64(SP),DX + IMUL3Q $38,DX,AX + MULQ 88(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 72(SP),AX + MULQ 72(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 72(SP),DX + IMUL3Q $38,DX,AX + MULQ 80(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 72(SP),DX + IMUL3Q $38,DX,AX + MULQ 88(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 80(SP),DX + IMUL3Q $19,DX,AX + MULQ 80(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 80(SP),DX + IMUL3Q $38,DX,AX + MULQ 88(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 88(SP),DX + IMUL3Q $19,DX,AX + MULQ 88(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + ANDQ DX,SI + MOVQ CX,R8 + SHRQ $51,CX + ADDQ R10,CX + ANDQ DX,R8 + MOVQ CX,R9 + SHRQ $51,CX + ADDQ R12,CX + ANDQ DX,R9 + MOVQ CX,AX + SHRQ $51,CX + ADDQ R14,CX + ANDQ DX,AX + MOVQ CX,R10 + SHRQ $51,CX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,176(SP) + MOVQ R8,184(SP) + MOVQ R9,192(SP) + MOVQ AX,200(SP) + MOVQ R10,208(SP) + MOVQ SI,SI + MOVQ R8,DX + MOVQ R9,CX + MOVQ AX,R8 + MOVQ R10,R9 + ADDQ ·_2P0(SB),SI + ADDQ ·_2P1234(SB),DX + ADDQ ·_2P1234(SB),CX + ADDQ ·_2P1234(SB),R8 + ADDQ ·_2P1234(SB),R9 + SUBQ 136(SP),SI + SUBQ 144(SP),DX + SUBQ 152(SP),CX + SUBQ 160(SP),R8 + SUBQ 168(SP),R9 + MOVQ SI,216(SP) + MOVQ DX,224(SP) + MOVQ CX,232(SP) + MOVQ R8,240(SP) + MOVQ R9,248(SP) + MOVQ 120(DI),SI + MOVQ 128(DI),DX + MOVQ 136(DI),CX + MOVQ 144(DI),R8 + MOVQ 152(DI),R9 + MOVQ SI,AX + MOVQ DX,R10 + MOVQ CX,R11 + MOVQ R8,R12 + MOVQ R9,R13 + ADDQ ·_2P0(SB),AX + ADDQ ·_2P1234(SB),R10 + ADDQ ·_2P1234(SB),R11 + ADDQ ·_2P1234(SB),R12 + ADDQ ·_2P1234(SB),R13 + ADDQ 160(DI),SI + ADDQ 168(DI),DX + ADDQ 176(DI),CX + ADDQ 184(DI),R8 + ADDQ 192(DI),R9 + SUBQ 160(DI),AX + SUBQ 168(DI),R10 + SUBQ 176(DI),R11 + SUBQ 184(DI),R12 + SUBQ 192(DI),R13 + MOVQ SI,256(SP) + MOVQ DX,264(SP) + MOVQ CX,272(SP) + MOVQ R8,280(SP) + MOVQ R9,288(SP) + MOVQ AX,296(SP) + MOVQ R10,304(SP) + MOVQ R11,312(SP) + MOVQ R12,320(SP) + MOVQ R13,328(SP) + MOVQ 280(SP),SI + IMUL3Q $19,SI,AX + MOVQ AX,336(SP) + MULQ 112(SP) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 288(SP),DX + IMUL3Q $19,DX,AX + MOVQ AX,344(SP) + MULQ 104(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 256(SP),AX + MULQ 96(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 256(SP),AX + MULQ 104(SP) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 256(SP),AX + MULQ 112(SP) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 256(SP),AX + MULQ 120(SP) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 256(SP),AX + MULQ 128(SP) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 264(SP),AX + MULQ 96(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 264(SP),AX + MULQ 104(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 264(SP),AX + MULQ 112(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 264(SP),AX + MULQ 120(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 264(SP),DX + IMUL3Q $19,DX,AX + MULQ 128(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 272(SP),AX + MULQ 96(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 272(SP),AX + MULQ 104(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 272(SP),AX + MULQ 112(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 272(SP),DX + IMUL3Q $19,DX,AX + MULQ 120(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 272(SP),DX + IMUL3Q $19,DX,AX + MULQ 128(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 280(SP),AX + MULQ 96(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 280(SP),AX + MULQ 104(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 336(SP),AX + MULQ 120(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 336(SP),AX + MULQ 128(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 288(SP),AX + MULQ 96(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 344(SP),AX + MULQ 112(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 344(SP),AX + MULQ 120(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 344(SP),AX + MULQ 128(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + MOVQ CX,R8 + SHRQ $51,CX + ANDQ DX,SI + ADDQ R10,CX + MOVQ CX,R9 + SHRQ $51,CX + ANDQ DX,R8 + ADDQ R12,CX + MOVQ CX,AX + SHRQ $51,CX + ANDQ DX,R9 + ADDQ R14,CX + MOVQ CX,R10 + SHRQ $51,CX + ANDQ DX,AX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,96(SP) + MOVQ R8,104(SP) + MOVQ R9,112(SP) + MOVQ AX,120(SP) + MOVQ R10,128(SP) + MOVQ 320(SP),SI + IMUL3Q $19,SI,AX + MOVQ AX,256(SP) + MULQ 72(SP) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 328(SP),DX + IMUL3Q $19,DX,AX + MOVQ AX,264(SP) + MULQ 64(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 296(SP),AX + MULQ 56(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 296(SP),AX + MULQ 64(SP) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 296(SP),AX + MULQ 72(SP) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 296(SP),AX + MULQ 80(SP) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 296(SP),AX + MULQ 88(SP) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 304(SP),AX + MULQ 56(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 304(SP),AX + MULQ 64(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 304(SP),AX + MULQ 72(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 304(SP),AX + MULQ 80(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 304(SP),DX + IMUL3Q $19,DX,AX + MULQ 88(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 312(SP),AX + MULQ 56(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 312(SP),AX + MULQ 64(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 312(SP),AX + MULQ 72(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 312(SP),DX + IMUL3Q $19,DX,AX + MULQ 80(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 312(SP),DX + IMUL3Q $19,DX,AX + MULQ 88(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 320(SP),AX + MULQ 56(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 320(SP),AX + MULQ 64(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 256(SP),AX + MULQ 80(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 256(SP),AX + MULQ 88(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 328(SP),AX + MULQ 56(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 264(SP),AX + MULQ 72(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 264(SP),AX + MULQ 80(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 264(SP),AX + MULQ 88(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + MOVQ CX,R8 + SHRQ $51,CX + ANDQ DX,SI + ADDQ R10,CX + MOVQ CX,R9 + SHRQ $51,CX + ANDQ DX,R8 + ADDQ R12,CX + MOVQ CX,AX + SHRQ $51,CX + ANDQ DX,R9 + ADDQ R14,CX + MOVQ CX,R10 + SHRQ $51,CX + ANDQ DX,AX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,DX + MOVQ R8,CX + MOVQ R9,R11 + MOVQ AX,R12 + MOVQ R10,R13 + ADDQ ·_2P0(SB),DX + ADDQ ·_2P1234(SB),CX + ADDQ ·_2P1234(SB),R11 + ADDQ ·_2P1234(SB),R12 + ADDQ ·_2P1234(SB),R13 + ADDQ 96(SP),SI + ADDQ 104(SP),R8 + ADDQ 112(SP),R9 + ADDQ 120(SP),AX + ADDQ 128(SP),R10 + SUBQ 96(SP),DX + SUBQ 104(SP),CX + SUBQ 112(SP),R11 + SUBQ 120(SP),R12 + SUBQ 128(SP),R13 + MOVQ SI,120(DI) + MOVQ R8,128(DI) + MOVQ R9,136(DI) + MOVQ AX,144(DI) + MOVQ R10,152(DI) + MOVQ DX,160(DI) + MOVQ CX,168(DI) + MOVQ R11,176(DI) + MOVQ R12,184(DI) + MOVQ R13,192(DI) + MOVQ 120(DI),AX + MULQ 120(DI) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 120(DI),AX + SHLQ $1,AX + MULQ 128(DI) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 120(DI),AX + SHLQ $1,AX + MULQ 136(DI) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 120(DI),AX + SHLQ $1,AX + MULQ 144(DI) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 120(DI),AX + SHLQ $1,AX + MULQ 152(DI) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 128(DI),AX + MULQ 128(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 128(DI),AX + SHLQ $1,AX + MULQ 136(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 128(DI),AX + SHLQ $1,AX + MULQ 144(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 128(DI),DX + IMUL3Q $38,DX,AX + MULQ 152(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 136(DI),AX + MULQ 136(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 136(DI),DX + IMUL3Q $38,DX,AX + MULQ 144(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 136(DI),DX + IMUL3Q $38,DX,AX + MULQ 152(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 144(DI),DX + IMUL3Q $19,DX,AX + MULQ 144(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 144(DI),DX + IMUL3Q $38,DX,AX + MULQ 152(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 152(DI),DX + IMUL3Q $19,DX,AX + MULQ 152(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + ANDQ DX,SI + MOVQ CX,R8 + SHRQ $51,CX + ADDQ R10,CX + ANDQ DX,R8 + MOVQ CX,R9 + SHRQ $51,CX + ADDQ R12,CX + ANDQ DX,R9 + MOVQ CX,AX + SHRQ $51,CX + ADDQ R14,CX + ANDQ DX,AX + MOVQ CX,R10 + SHRQ $51,CX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,120(DI) + MOVQ R8,128(DI) + MOVQ R9,136(DI) + MOVQ AX,144(DI) + MOVQ R10,152(DI) + MOVQ 160(DI),AX + MULQ 160(DI) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 160(DI),AX + SHLQ $1,AX + MULQ 168(DI) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 160(DI),AX + SHLQ $1,AX + MULQ 176(DI) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 160(DI),AX + SHLQ $1,AX + MULQ 184(DI) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 160(DI),AX + SHLQ $1,AX + MULQ 192(DI) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 168(DI),AX + MULQ 168(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 168(DI),AX + SHLQ $1,AX + MULQ 176(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 168(DI),AX + SHLQ $1,AX + MULQ 184(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 168(DI),DX + IMUL3Q $38,DX,AX + MULQ 192(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 176(DI),AX + MULQ 176(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 176(DI),DX + IMUL3Q $38,DX,AX + MULQ 184(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 176(DI),DX + IMUL3Q $38,DX,AX + MULQ 192(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 184(DI),DX + IMUL3Q $19,DX,AX + MULQ 184(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 184(DI),DX + IMUL3Q $38,DX,AX + MULQ 192(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 192(DI),DX + IMUL3Q $19,DX,AX + MULQ 192(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + ANDQ DX,SI + MOVQ CX,R8 + SHRQ $51,CX + ADDQ R10,CX + ANDQ DX,R8 + MOVQ CX,R9 + SHRQ $51,CX + ADDQ R12,CX + ANDQ DX,R9 + MOVQ CX,AX + SHRQ $51,CX + ADDQ R14,CX + ANDQ DX,AX + MOVQ CX,R10 + SHRQ $51,CX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,160(DI) + MOVQ R8,168(DI) + MOVQ R9,176(DI) + MOVQ AX,184(DI) + MOVQ R10,192(DI) + MOVQ 184(DI),SI + IMUL3Q $19,SI,AX + MOVQ AX,56(SP) + MULQ 16(DI) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 192(DI),DX + IMUL3Q $19,DX,AX + MOVQ AX,64(SP) + MULQ 8(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 160(DI),AX + MULQ 0(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 160(DI),AX + MULQ 8(DI) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 160(DI),AX + MULQ 16(DI) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 160(DI),AX + MULQ 24(DI) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 160(DI),AX + MULQ 32(DI) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 168(DI),AX + MULQ 0(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 168(DI),AX + MULQ 8(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 168(DI),AX + MULQ 16(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 168(DI),AX + MULQ 24(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 168(DI),DX + IMUL3Q $19,DX,AX + MULQ 32(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 176(DI),AX + MULQ 0(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 176(DI),AX + MULQ 8(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 176(DI),AX + MULQ 16(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 176(DI),DX + IMUL3Q $19,DX,AX + MULQ 24(DI) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 176(DI),DX + IMUL3Q $19,DX,AX + MULQ 32(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 184(DI),AX + MULQ 0(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 184(DI),AX + MULQ 8(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 56(SP),AX + MULQ 24(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 56(SP),AX + MULQ 32(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 192(DI),AX + MULQ 0(DI) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 64(SP),AX + MULQ 16(DI) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 64(SP),AX + MULQ 24(DI) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 64(SP),AX + MULQ 32(DI) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + MOVQ CX,R8 + SHRQ $51,CX + ANDQ DX,SI + ADDQ R10,CX + MOVQ CX,R9 + SHRQ $51,CX + ANDQ DX,R8 + ADDQ R12,CX + MOVQ CX,AX + SHRQ $51,CX + ANDQ DX,R9 + ADDQ R14,CX + MOVQ CX,R10 + SHRQ $51,CX + ANDQ DX,AX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,160(DI) + MOVQ R8,168(DI) + MOVQ R9,176(DI) + MOVQ AX,184(DI) + MOVQ R10,192(DI) + MOVQ 200(SP),SI + IMUL3Q $19,SI,AX + MOVQ AX,56(SP) + MULQ 152(SP) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 208(SP),DX + IMUL3Q $19,DX,AX + MOVQ AX,64(SP) + MULQ 144(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 176(SP),AX + MULQ 136(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 176(SP),AX + MULQ 144(SP) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 176(SP),AX + MULQ 152(SP) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 176(SP),AX + MULQ 160(SP) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 176(SP),AX + MULQ 168(SP) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 184(SP),AX + MULQ 136(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 184(SP),AX + MULQ 144(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 184(SP),AX + MULQ 152(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 184(SP),AX + MULQ 160(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 184(SP),DX + IMUL3Q $19,DX,AX + MULQ 168(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 192(SP),AX + MULQ 136(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 192(SP),AX + MULQ 144(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 192(SP),AX + MULQ 152(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 192(SP),DX + IMUL3Q $19,DX,AX + MULQ 160(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 192(SP),DX + IMUL3Q $19,DX,AX + MULQ 168(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 200(SP),AX + MULQ 136(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 200(SP),AX + MULQ 144(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 56(SP),AX + MULQ 160(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 56(SP),AX + MULQ 168(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 208(SP),AX + MULQ 136(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 64(SP),AX + MULQ 152(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 64(SP),AX + MULQ 160(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 64(SP),AX + MULQ 168(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + MOVQ CX,R8 + SHRQ $51,CX + ANDQ DX,SI + ADDQ R10,CX + MOVQ CX,R9 + SHRQ $51,CX + ANDQ DX,R8 + ADDQ R12,CX + MOVQ CX,AX + SHRQ $51,CX + ANDQ DX,R9 + ADDQ R14,CX + MOVQ CX,R10 + SHRQ $51,CX + ANDQ DX,AX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,40(DI) + MOVQ R8,48(DI) + MOVQ R9,56(DI) + MOVQ AX,64(DI) + MOVQ R10,72(DI) + MOVQ 216(SP),AX + MULQ ·_121666_213(SB) + SHRQ $13,AX + MOVQ AX,SI + MOVQ DX,CX + MOVQ 224(SP),AX + MULQ ·_121666_213(SB) + SHRQ $13,AX + ADDQ AX,CX + MOVQ DX,R8 + MOVQ 232(SP),AX + MULQ ·_121666_213(SB) + SHRQ $13,AX + ADDQ AX,R8 + MOVQ DX,R9 + MOVQ 240(SP),AX + MULQ ·_121666_213(SB) + SHRQ $13,AX + ADDQ AX,R9 + MOVQ DX,R10 + MOVQ 248(SP),AX + MULQ ·_121666_213(SB) + SHRQ $13,AX + ADDQ AX,R10 + IMUL3Q $19,DX,DX + ADDQ DX,SI + ADDQ 136(SP),SI + ADDQ 144(SP),CX + ADDQ 152(SP),R8 + ADDQ 160(SP),R9 + ADDQ 168(SP),R10 + MOVQ SI,80(DI) + MOVQ CX,88(DI) + MOVQ R8,96(DI) + MOVQ R9,104(DI) + MOVQ R10,112(DI) + MOVQ 104(DI),SI + IMUL3Q $19,SI,AX + MOVQ AX,56(SP) + MULQ 232(SP) + MOVQ AX,SI + MOVQ DX,CX + MOVQ 112(DI),DX + IMUL3Q $19,DX,AX + MOVQ AX,64(SP) + MULQ 224(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 80(DI),AX + MULQ 216(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 80(DI),AX + MULQ 224(SP) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 80(DI),AX + MULQ 232(SP) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 80(DI),AX + MULQ 240(SP) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 80(DI),AX + MULQ 248(SP) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 88(DI),AX + MULQ 216(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 88(DI),AX + MULQ 224(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 88(DI),AX + MULQ 232(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 88(DI),AX + MULQ 240(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 88(DI),DX + IMUL3Q $19,DX,AX + MULQ 248(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 96(DI),AX + MULQ 216(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 96(DI),AX + MULQ 224(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 96(DI),AX + MULQ 232(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 96(DI),DX + IMUL3Q $19,DX,AX + MULQ 240(SP) + ADDQ AX,SI + ADCQ DX,CX + MOVQ 96(DI),DX + IMUL3Q $19,DX,AX + MULQ 248(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 104(DI),AX + MULQ 216(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 104(DI),AX + MULQ 224(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 56(SP),AX + MULQ 240(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 56(SP),AX + MULQ 248(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 112(DI),AX + MULQ 216(SP) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 64(SP),AX + MULQ 232(SP) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 64(SP),AX + MULQ 240(SP) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 64(SP),AX + MULQ 248(SP) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ ·REDMASK51(SB),DX + SHLQ $13,CX:SI + ANDQ DX,SI + SHLQ $13,R9:R8 + ANDQ DX,R8 + ADDQ CX,R8 + SHLQ $13,R11:R10 + ANDQ DX,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ DX,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ DX,R14 + ADDQ R13,R14 + IMUL3Q $19,R15,CX + ADDQ CX,SI + MOVQ SI,CX + SHRQ $51,CX + ADDQ R8,CX + MOVQ CX,R8 + SHRQ $51,CX + ANDQ DX,SI + ADDQ R10,CX + MOVQ CX,R9 + SHRQ $51,CX + ANDQ DX,R8 + ADDQ R12,CX + MOVQ CX,AX + SHRQ $51,CX + ANDQ DX,R9 + ADDQ R14,CX + MOVQ CX,R10 + SHRQ $51,CX + ANDQ DX,AX + IMUL3Q $19,CX,CX + ADDQ CX,SI + ANDQ DX,R10 + MOVQ SI,80(DI) + MOVQ R8,88(DI) + MOVQ R9,96(DI) + MOVQ AX,104(DI) + MOVQ R10,112(DI) + MOVQ 0(SP),R11 + MOVQ 8(SP),R12 + MOVQ 16(SP),R13 + MOVQ 24(SP),R14 + MOVQ 32(SP),R15 + MOVQ 40(SP),BX + MOVQ 48(SP),BP + MOVQ R11,SP + MOVQ DI,AX + MOVQ SI,DX + RET diff --git a/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go b/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go new file mode 100644 index 0000000000..5822bd5338 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/mont25519_amd64.go @@ -0,0 +1,240 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64,!gccgo,!appengine + +package curve25519 + +// These functions are implemented in the .s files. The names of the functions +// in the rest of the file are also taken from the SUPERCOP sources to help +// people following along. + +//go:noescape + +func cswap(inout *[5]uint64, v uint64) + +//go:noescape + +func ladderstep(inout *[5][5]uint64) + +//go:noescape + +func freeze(inout *[5]uint64) + +//go:noescape + +func mul(dest, a, b *[5]uint64) + +//go:noescape + +func square(out, in *[5]uint64) + +// mladder uses a Montgomery ladder to calculate (xr/zr) *= s. +func mladder(xr, zr *[5]uint64, s *[32]byte) { + var work [5][5]uint64 + + work[0] = *xr + setint(&work[1], 1) + setint(&work[2], 0) + work[3] = *xr + setint(&work[4], 1) + + j := uint(6) + var prevbit byte + + for i := 31; i >= 0; i-- { + for j < 8 { + bit := ((*s)[i] >> j) & 1 + swap := bit ^ prevbit + prevbit = bit + cswap(&work[1], uint64(swap)) + ladderstep(&work) + j-- + } + j = 7 + } + + *xr = work[1] + *zr = work[2] +} + +func scalarMult(out, in, base *[32]byte) { + var e [32]byte + copy(e[:], (*in)[:]) + e[0] &= 248 + e[31] &= 127 + e[31] |= 64 + + var t, z [5]uint64 + unpack(&t, base) + mladder(&t, &z, &e) + invert(&z, &z) + mul(&t, &t, &z) + pack(out, &t) +} + +func setint(r *[5]uint64, v uint64) { + r[0] = v + r[1] = 0 + r[2] = 0 + r[3] = 0 + r[4] = 0 +} + +// unpack sets r = x where r consists of 5, 51-bit limbs in little-endian +// order. +func unpack(r *[5]uint64, x *[32]byte) { + r[0] = uint64(x[0]) | + uint64(x[1])<<8 | + uint64(x[2])<<16 | + uint64(x[3])<<24 | + uint64(x[4])<<32 | + uint64(x[5])<<40 | + uint64(x[6]&7)<<48 + + r[1] = uint64(x[6])>>3 | + uint64(x[7])<<5 | + uint64(x[8])<<13 | + uint64(x[9])<<21 | + uint64(x[10])<<29 | + uint64(x[11])<<37 | + uint64(x[12]&63)<<45 + + r[2] = uint64(x[12])>>6 | + uint64(x[13])<<2 | + uint64(x[14])<<10 | + uint64(x[15])<<18 | + uint64(x[16])<<26 | + uint64(x[17])<<34 | + uint64(x[18])<<42 | + uint64(x[19]&1)<<50 + + r[3] = uint64(x[19])>>1 | + uint64(x[20])<<7 | + uint64(x[21])<<15 | + uint64(x[22])<<23 | + uint64(x[23])<<31 | + uint64(x[24])<<39 | + uint64(x[25]&15)<<47 + + r[4] = uint64(x[25])>>4 | + uint64(x[26])<<4 | + uint64(x[27])<<12 | + uint64(x[28])<<20 | + uint64(x[29])<<28 | + uint64(x[30])<<36 | + uint64(x[31]&127)<<44 +} + +// pack sets out = x where out is the usual, little-endian form of the 5, +// 51-bit limbs in x. +func pack(out *[32]byte, x *[5]uint64) { + t := *x + freeze(&t) + + out[0] = byte(t[0]) + out[1] = byte(t[0] >> 8) + out[2] = byte(t[0] >> 16) + out[3] = byte(t[0] >> 24) + out[4] = byte(t[0] >> 32) + out[5] = byte(t[0] >> 40) + out[6] = byte(t[0] >> 48) + + out[6] ^= byte(t[1]<<3) & 0xf8 + out[7] = byte(t[1] >> 5) + out[8] = byte(t[1] >> 13) + out[9] = byte(t[1] >> 21) + out[10] = byte(t[1] >> 29) + out[11] = byte(t[1] >> 37) + out[12] = byte(t[1] >> 45) + + out[12] ^= byte(t[2]<<6) & 0xc0 + out[13] = byte(t[2] >> 2) + out[14] = byte(t[2] >> 10) + out[15] = byte(t[2] >> 18) + out[16] = byte(t[2] >> 26) + out[17] = byte(t[2] >> 34) + out[18] = byte(t[2] >> 42) + out[19] = byte(t[2] >> 50) + + out[19] ^= byte(t[3]<<1) & 0xfe + out[20] = byte(t[3] >> 7) + out[21] = byte(t[3] >> 15) + out[22] = byte(t[3] >> 23) + out[23] = byte(t[3] >> 31) + out[24] = byte(t[3] >> 39) + out[25] = byte(t[3] >> 47) + + out[25] ^= byte(t[4]<<4) & 0xf0 + out[26] = byte(t[4] >> 4) + out[27] = byte(t[4] >> 12) + out[28] = byte(t[4] >> 20) + out[29] = byte(t[4] >> 28) + out[30] = byte(t[4] >> 36) + out[31] = byte(t[4] >> 44) +} + +// invert calculates r = x^-1 mod p using Fermat's little theorem. +func invert(r *[5]uint64, x *[5]uint64) { + var z2, z9, z11, z2_5_0, z2_10_0, z2_20_0, z2_50_0, z2_100_0, t [5]uint64 + + square(&z2, x) /* 2 */ + square(&t, &z2) /* 4 */ + square(&t, &t) /* 8 */ + mul(&z9, &t, x) /* 9 */ + mul(&z11, &z9, &z2) /* 11 */ + square(&t, &z11) /* 22 */ + mul(&z2_5_0, &t, &z9) /* 2^5 - 2^0 = 31 */ + + square(&t, &z2_5_0) /* 2^6 - 2^1 */ + for i := 1; i < 5; i++ { /* 2^20 - 2^10 */ + square(&t, &t) + } + mul(&z2_10_0, &t, &z2_5_0) /* 2^10 - 2^0 */ + + square(&t, &z2_10_0) /* 2^11 - 2^1 */ + for i := 1; i < 10; i++ { /* 2^20 - 2^10 */ + square(&t, &t) + } + mul(&z2_20_0, &t, &z2_10_0) /* 2^20 - 2^0 */ + + square(&t, &z2_20_0) /* 2^21 - 2^1 */ + for i := 1; i < 20; i++ { /* 2^40 - 2^20 */ + square(&t, &t) + } + mul(&t, &t, &z2_20_0) /* 2^40 - 2^0 */ + + square(&t, &t) /* 2^41 - 2^1 */ + for i := 1; i < 10; i++ { /* 2^50 - 2^10 */ + square(&t, &t) + } + mul(&z2_50_0, &t, &z2_10_0) /* 2^50 - 2^0 */ + + square(&t, &z2_50_0) /* 2^51 - 2^1 */ + for i := 1; i < 50; i++ { /* 2^100 - 2^50 */ + square(&t, &t) + } + mul(&z2_100_0, &t, &z2_50_0) /* 2^100 - 2^0 */ + + square(&t, &z2_100_0) /* 2^101 - 2^1 */ + for i := 1; i < 100; i++ { /* 2^200 - 2^100 */ + square(&t, &t) + } + mul(&t, &t, &z2_100_0) /* 2^200 - 2^0 */ + + square(&t, &t) /* 2^201 - 2^1 */ + for i := 1; i < 50; i++ { /* 2^250 - 2^50 */ + square(&t, &t) + } + mul(&t, &t, &z2_50_0) /* 2^250 - 2^0 */ + + square(&t, &t) /* 2^251 - 2^1 */ + square(&t, &t) /* 2^252 - 2^2 */ + square(&t, &t) /* 2^253 - 2^3 */ + + square(&t, &t) /* 2^254 - 2^4 */ + + square(&t, &t) /* 2^255 - 2^5 */ + mul(r, &t, &z11) /* 2^255 - 21 */ +} diff --git a/vendor/golang.org/x/crypto/curve25519/mul_amd64.s b/vendor/golang.org/x/crypto/curve25519/mul_amd64.s new file mode 100644 index 0000000000..e48d183ee5 --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/mul_amd64.s @@ -0,0 +1,191 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +// +build amd64,!gccgo,!appengine + +// func mul(dest, a, b *[5]uint64) +TEXT ·mul(SB),0,$128-24 + MOVQ dest+0(FP), DI + MOVQ a+8(FP), SI + MOVQ b+16(FP), DX + + MOVQ SP,R11 + MOVQ $31,CX + NOTQ CX + ANDQ CX,SP + ADDQ $32,SP + + MOVQ R11,0(SP) + MOVQ R12,8(SP) + MOVQ R13,16(SP) + MOVQ R14,24(SP) + MOVQ R15,32(SP) + MOVQ BX,40(SP) + MOVQ BP,48(SP) + MOVQ DI,56(SP) + MOVQ DX,CX + MOVQ 24(SI),DX + IMUL3Q $19,DX,AX + MOVQ AX,64(SP) + MULQ 16(CX) + MOVQ AX,R8 + MOVQ DX,R9 + MOVQ 32(SI),DX + IMUL3Q $19,DX,AX + MOVQ AX,72(SP) + MULQ 8(CX) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 0(SI),AX + MULQ 0(CX) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 0(SI),AX + MULQ 8(CX) + MOVQ AX,R10 + MOVQ DX,R11 + MOVQ 0(SI),AX + MULQ 16(CX) + MOVQ AX,R12 + MOVQ DX,R13 + MOVQ 0(SI),AX + MULQ 24(CX) + MOVQ AX,R14 + MOVQ DX,R15 + MOVQ 0(SI),AX + MULQ 32(CX) + MOVQ AX,BX + MOVQ DX,BP + MOVQ 8(SI),AX + MULQ 0(CX) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 8(SI),AX + MULQ 8(CX) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 8(SI),AX + MULQ 16(CX) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 8(SI),AX + MULQ 24(CX) + ADDQ AX,BX + ADCQ DX,BP + MOVQ 8(SI),DX + IMUL3Q $19,DX,AX + MULQ 32(CX) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 16(SI),AX + MULQ 0(CX) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 16(SI),AX + MULQ 8(CX) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 16(SI),AX + MULQ 16(CX) + ADDQ AX,BX + ADCQ DX,BP + MOVQ 16(SI),DX + IMUL3Q $19,DX,AX + MULQ 24(CX) + ADDQ AX,R8 + ADCQ DX,R9 + MOVQ 16(SI),DX + IMUL3Q $19,DX,AX + MULQ 32(CX) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 24(SI),AX + MULQ 0(CX) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ 24(SI),AX + MULQ 8(CX) + ADDQ AX,BX + ADCQ DX,BP + MOVQ 64(SP),AX + MULQ 24(CX) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 64(SP),AX + MULQ 32(CX) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 32(SI),AX + MULQ 0(CX) + ADDQ AX,BX + ADCQ DX,BP + MOVQ 72(SP),AX + MULQ 16(CX) + ADDQ AX,R10 + ADCQ DX,R11 + MOVQ 72(SP),AX + MULQ 24(CX) + ADDQ AX,R12 + ADCQ DX,R13 + MOVQ 72(SP),AX + MULQ 32(CX) + ADDQ AX,R14 + ADCQ DX,R15 + MOVQ ·REDMASK51(SB),SI + SHLQ $13,R9:R8 + ANDQ SI,R8 + SHLQ $13,R11:R10 + ANDQ SI,R10 + ADDQ R9,R10 + SHLQ $13,R13:R12 + ANDQ SI,R12 + ADDQ R11,R12 + SHLQ $13,R15:R14 + ANDQ SI,R14 + ADDQ R13,R14 + SHLQ $13,BP:BX + ANDQ SI,BX + ADDQ R15,BX + IMUL3Q $19,BP,DX + ADDQ DX,R8 + MOVQ R8,DX + SHRQ $51,DX + ADDQ R10,DX + MOVQ DX,CX + SHRQ $51,DX + ANDQ SI,R8 + ADDQ R12,DX + MOVQ DX,R9 + SHRQ $51,DX + ANDQ SI,CX + ADDQ R14,DX + MOVQ DX,AX + SHRQ $51,DX + ANDQ SI,R9 + ADDQ BX,DX + MOVQ DX,R10 + SHRQ $51,DX + ANDQ SI,AX + IMUL3Q $19,DX,DX + ADDQ DX,R8 + ANDQ SI,R10 + MOVQ R8,0(DI) + MOVQ CX,8(DI) + MOVQ R9,16(DI) + MOVQ AX,24(DI) + MOVQ R10,32(DI) + MOVQ 0(SP),R11 + MOVQ 8(SP),R12 + MOVQ 16(SP),R13 + MOVQ 24(SP),R14 + MOVQ 32(SP),R15 + MOVQ 40(SP),BX + MOVQ 48(SP),BP + MOVQ R11,SP + MOVQ DI,AX + MOVQ SI,DX + RET diff --git a/vendor/golang.org/x/crypto/curve25519/square_amd64.s b/vendor/golang.org/x/crypto/curve25519/square_amd64.s new file mode 100644 index 0000000000..78d1a50ddc --- /dev/null +++ b/vendor/golang.org/x/crypto/curve25519/square_amd64.s @@ -0,0 +1,153 @@ +// Copyright 2012 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code was translated into a form compatible with 6a from the public +// domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html + +// +build amd64,!gccgo,!appengine + +// func square(out, in *[5]uint64) +TEXT ·square(SB),7,$96-16 + MOVQ out+0(FP), DI + MOVQ in+8(FP), SI + + MOVQ SP,R11 + MOVQ $31,CX + NOTQ CX + ANDQ CX,SP + ADDQ $32, SP + + MOVQ R11,0(SP) + MOVQ R12,8(SP) + MOVQ R13,16(SP) + MOVQ R14,24(SP) + MOVQ R15,32(SP) + MOVQ BX,40(SP) + MOVQ BP,48(SP) + MOVQ 0(SI),AX + MULQ 0(SI) + MOVQ AX,CX + MOVQ DX,R8 + MOVQ 0(SI),AX + SHLQ $1,AX + MULQ 8(SI) + MOVQ AX,R9 + MOVQ DX,R10 + MOVQ 0(SI),AX + SHLQ $1,AX + MULQ 16(SI) + MOVQ AX,R11 + MOVQ DX,R12 + MOVQ 0(SI),AX + SHLQ $1,AX + MULQ 24(SI) + MOVQ AX,R13 + MOVQ DX,R14 + MOVQ 0(SI),AX + SHLQ $1,AX + MULQ 32(SI) + MOVQ AX,R15 + MOVQ DX,BX + MOVQ 8(SI),AX + MULQ 8(SI) + ADDQ AX,R11 + ADCQ DX,R12 + MOVQ 8(SI),AX + SHLQ $1,AX + MULQ 16(SI) + ADDQ AX,R13 + ADCQ DX,R14 + MOVQ 8(SI),AX + SHLQ $1,AX + MULQ 24(SI) + ADDQ AX,R15 + ADCQ DX,BX + MOVQ 8(SI),DX + IMUL3Q $38,DX,AX + MULQ 32(SI) + ADDQ AX,CX + ADCQ DX,R8 + MOVQ 16(SI),AX + MULQ 16(SI) + ADDQ AX,R15 + ADCQ DX,BX + MOVQ 16(SI),DX + IMUL3Q $38,DX,AX + MULQ 24(SI) + ADDQ AX,CX + ADCQ DX,R8 + MOVQ 16(SI),DX + IMUL3Q $38,DX,AX + MULQ 32(SI) + ADDQ AX,R9 + ADCQ DX,R10 + MOVQ 24(SI),DX + IMUL3Q $19,DX,AX + MULQ 24(SI) + ADDQ AX,R9 + ADCQ DX,R10 + MOVQ 24(SI),DX + IMUL3Q $38,DX,AX + MULQ 32(SI) + ADDQ AX,R11 + ADCQ DX,R12 + MOVQ 32(SI),DX + IMUL3Q $19,DX,AX + MULQ 32(SI) + ADDQ AX,R13 + ADCQ DX,R14 + MOVQ ·REDMASK51(SB),SI + SHLQ $13,R8:CX + ANDQ SI,CX + SHLQ $13,R10:R9 + ANDQ SI,R9 + ADDQ R8,R9 + SHLQ $13,R12:R11 + ANDQ SI,R11 + ADDQ R10,R11 + SHLQ $13,R14:R13 + ANDQ SI,R13 + ADDQ R12,R13 + SHLQ $13,BX:R15 + ANDQ SI,R15 + ADDQ R14,R15 + IMUL3Q $19,BX,DX + ADDQ DX,CX + MOVQ CX,DX + SHRQ $51,DX + ADDQ R9,DX + ANDQ SI,CX + MOVQ DX,R8 + SHRQ $51,DX + ADDQ R11,DX + ANDQ SI,R8 + MOVQ DX,R9 + SHRQ $51,DX + ADDQ R13,DX + ANDQ SI,R9 + MOVQ DX,AX + SHRQ $51,DX + ADDQ R15,DX + ANDQ SI,AX + MOVQ DX,R10 + SHRQ $51,DX + IMUL3Q $19,DX,DX + ADDQ DX,CX + ANDQ SI,R10 + MOVQ CX,0(DI) + MOVQ R8,8(DI) + MOVQ R9,16(DI) + MOVQ AX,24(DI) + MOVQ R10,32(DI) + MOVQ 0(SP),R11 + MOVQ 8(SP),R12 + MOVQ 16(SP),R13 + MOVQ 24(SP),R14 + MOVQ 32(SP),R15 + MOVQ 40(SP),BX + MOVQ 48(SP),BP + MOVQ R11,SP + MOVQ DI,AX + MOVQ SI,DX + RET diff --git a/vendor/golang.org/x/crypto/ssh/agent/client.go b/vendor/golang.org/x/crypto/ssh/agent/client.go index 7f2ae50274..d043c5bec2 100644 --- a/vendor/golang.org/x/crypto/ssh/agent/client.go +++ b/vendor/golang.org/x/crypto/ssh/agent/client.go @@ -6,7 +6,7 @@ Package agent implements a client to an ssh-agent daemon. References: - [PROTOCOL.agent]: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent + [PROTOCOL.agent]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.agent?rev=HEAD */ package agent @@ -36,9 +36,8 @@ type Agent interface { // in [PROTOCOL.agent] section 2.6.2. Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error) - // Insert adds a private key to the agent. If a certificate - // is given, that certificate is added as public key. - Add(s interface{}, cert *ssh.Certificate, comment string) error + // Add adds a private key to the agent. + Add(key AddedKey) error // Remove removes all identities with the given public key. Remove(key ssh.PublicKey) error @@ -56,6 +55,24 @@ type Agent interface { Signers() ([]ssh.Signer, error) } +// AddedKey describes an SSH key to be added to an Agent. +type AddedKey struct { + // PrivateKey must be a *rsa.PrivateKey, *dsa.PrivateKey or + // *ecdsa.PrivateKey, which will be inserted into the agent. + PrivateKey interface{} + // Certificate, if not nil, is communicated to the agent and will be + // stored with the key. + Certificate *ssh.Certificate + // Comment is an optional, free-form string. + Comment string + // LifetimeSecs, if not zero, is the number of seconds that the + // agent will store the key for. + LifetimeSecs uint32 + // ConfirmBeforeUse, if true, requests that the agent confirm with the + // user before each use of this key. + ConfirmBeforeUse bool +} + // See [PROTOCOL.agent], section 3. const ( agentRequestV1Identities = 1 @@ -368,36 +385,39 @@ func unmarshal(packet []byte) (interface{}, error) { } type rsaKeyMsg struct { - Type string `sshtype:"17"` - N *big.Int - E *big.Int - D *big.Int - Iqmp *big.Int // IQMP = Inverse Q Mod P - P *big.Int - Q *big.Int - Comments string + Type string `sshtype:"17"` + N *big.Int + E *big.Int + D *big.Int + Iqmp *big.Int // IQMP = Inverse Q Mod P + P *big.Int + Q *big.Int + Comments string + Constraints []byte `ssh:"rest"` } type dsaKeyMsg struct { - Type string `sshtype:"17"` - P *big.Int - Q *big.Int - G *big.Int - Y *big.Int - X *big.Int - Comments string + Type string `sshtype:"17"` + P *big.Int + Q *big.Int + G *big.Int + Y *big.Int + X *big.Int + Comments string + Constraints []byte `ssh:"rest"` } type ecdsaKeyMsg struct { - Type string `sshtype:"17"` - Curve string - KeyBytes []byte - D *big.Int - Comments string + Type string `sshtype:"17"` + Curve string + KeyBytes []byte + D *big.Int + Comments string + Constraints []byte `ssh:"rest"` } // Insert adds a private key to the agent. -func (c *client) insertKey(s interface{}, comment string) error { +func (c *client) insertKey(s interface{}, comment string, constraints []byte) error { var req []byte switch k := s.(type) { case *rsa.PrivateKey: @@ -406,37 +426,46 @@ func (c *client) insertKey(s interface{}, comment string) error { } k.Precompute() req = ssh.Marshal(rsaKeyMsg{ - Type: ssh.KeyAlgoRSA, - N: k.N, - E: big.NewInt(int64(k.E)), - D: k.D, - Iqmp: k.Precomputed.Qinv, - P: k.Primes[0], - Q: k.Primes[1], - Comments: comment, + Type: ssh.KeyAlgoRSA, + N: k.N, + E: big.NewInt(int64(k.E)), + D: k.D, + Iqmp: k.Precomputed.Qinv, + P: k.Primes[0], + Q: k.Primes[1], + Comments: comment, + Constraints: constraints, }) case *dsa.PrivateKey: req = ssh.Marshal(dsaKeyMsg{ - Type: ssh.KeyAlgoDSA, - P: k.P, - Q: k.Q, - G: k.G, - Y: k.Y, - X: k.X, - Comments: comment, + Type: ssh.KeyAlgoDSA, + P: k.P, + Q: k.Q, + G: k.G, + Y: k.Y, + X: k.X, + Comments: comment, + Constraints: constraints, }) case *ecdsa.PrivateKey: nistID := fmt.Sprintf("nistp%d", k.Params().BitSize) req = ssh.Marshal(ecdsaKeyMsg{ - Type: "ecdsa-sha2-" + nistID, - Curve: nistID, - KeyBytes: elliptic.Marshal(k.Curve, k.X, k.Y), - D: k.D, - Comments: comment, + Type: "ecdsa-sha2-" + nistID, + Curve: nistID, + KeyBytes: elliptic.Marshal(k.Curve, k.X, k.Y), + D: k.D, + Comments: comment, + Constraints: constraints, }) default: return fmt.Errorf("agent: unsupported key type %T", s) } + + // if constraints are present then the message type needs to be changed. + if len(constraints) != 0 { + req[0] = agentAddIdConstrained + } + resp, err := c.call(req) if err != nil { return err @@ -448,40 +477,57 @@ func (c *client) insertKey(s interface{}, comment string) error { } type rsaCertMsg struct { - Type string `sshtype:"17"` - CertBytes []byte - D *big.Int - Iqmp *big.Int // IQMP = Inverse Q Mod P - P *big.Int - Q *big.Int - Comments string + Type string `sshtype:"17"` + CertBytes []byte + D *big.Int + Iqmp *big.Int // IQMP = Inverse Q Mod P + P *big.Int + Q *big.Int + Comments string + Constraints []byte `ssh:"rest"` } type dsaCertMsg struct { - Type string `sshtype:"17"` - CertBytes []byte - X *big.Int - Comments string + Type string `sshtype:"17"` + CertBytes []byte + X *big.Int + Comments string + Constraints []byte `ssh:"rest"` } type ecdsaCertMsg struct { - Type string `sshtype:"17"` - CertBytes []byte - D *big.Int - Comments string + Type string `sshtype:"17"` + CertBytes []byte + D *big.Int + Comments string + Constraints []byte `ssh:"rest"` } // Insert adds a private key to the agent. If a certificate is given, // that certificate is added instead as public key. -func (c *client) Add(s interface{}, cert *ssh.Certificate, comment string) error { - if cert == nil { - return c.insertKey(s, comment) +func (c *client) Add(key AddedKey) error { + var constraints []byte + + if secs := key.LifetimeSecs; secs != 0 { + constraints = append(constraints, agentConstrainLifetime) + + var secsBytes [4]byte + binary.BigEndian.PutUint32(secsBytes[:], secs) + constraints = append(constraints, secsBytes[:]...) + } + + if key.ConfirmBeforeUse { + constraints = append(constraints, agentConstrainConfirm) + } + + if cert := key.Certificate; cert == nil { + return c.insertKey(key.PrivateKey, key.Comment, constraints) } else { - return c.insertCert(s, cert, comment) + return c.insertCert(key.PrivateKey, cert, key.Comment, constraints) } } -func (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string) error { +func (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string, constraints []byte) error { var req []byte switch k := s.(type) { case *rsa.PrivateKey: @@ -490,13 +536,14 @@ func (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string } k.Precompute() req = ssh.Marshal(rsaCertMsg{ - Type: cert.Type(), - CertBytes: cert.Marshal(), - D: k.D, - Iqmp: k.Precomputed.Qinv, - P: k.Primes[0], - Q: k.Primes[1], - Comments: comment, + Type: cert.Type(), + CertBytes: cert.Marshal(), + D: k.D, + Iqmp: k.Precomputed.Qinv, + P: k.Primes[0], + Q: k.Primes[1], + Comments: comment, + Constraints: constraints, }) case *dsa.PrivateKey: req = ssh.Marshal(dsaCertMsg{ @@ -516,6 +563,11 @@ func (c *client) insertCert(s interface{}, cert *ssh.Certificate, comment string return fmt.Errorf("agent: unsupported key type %T", s) } + // if constraints are present then the message type needs to be changed. + if len(constraints) != 0 { + req[0] = agentAddIdConstrained + } + signer, err := ssh.NewSignerFromKey(s) if err != nil { return err diff --git a/vendor/golang.org/x/crypto/ssh/agent/keyring.go b/vendor/golang.org/x/crypto/ssh/agent/keyring.go index 831a5b9ae5..11b72dfd9e 100644 --- a/vendor/golang.org/x/crypto/ssh/agent/keyring.go +++ b/vendor/golang.org/x/crypto/ssh/agent/keyring.go @@ -125,27 +125,28 @@ func (r *keyring) List() ([]*Key, error) { } // Insert adds a private key to the keyring. If a certificate -// is given, that certificate is added as public key. -func (r *keyring) Add(priv interface{}, cert *ssh.Certificate, comment string) error { +// is given, that certificate is added as public key. Note that +// any constraints given are ignored. +func (r *keyring) Add(key AddedKey) error { r.mu.Lock() defer r.mu.Unlock() if r.locked { return errLocked } - signer, err := ssh.NewSignerFromKey(priv) + signer, err := ssh.NewSignerFromKey(key.PrivateKey) if err != nil { return err } - if cert != nil { + if cert := key.Certificate; cert != nil { signer, err = ssh.NewCertSigner(cert, signer) if err != nil { return err } } - r.keys = append(r.keys, privKey{signer, comment}) + r.keys = append(r.keys, privKey{signer, key.Comment}) return nil } @@ -175,7 +176,7 @@ func (r *keyring) Signers() ([]ssh.Signer, error) { return nil, errLocked } - s := make([]ssh.Signer, len(r.keys)) + s := make([]ssh.Signer, 0, len(r.keys)) for _, k := range r.keys { s = append(s, k.signer) } diff --git a/vendor/golang.org/x/crypto/ssh/agent/server.go b/vendor/golang.org/x/crypto/ssh/agent/server.go index be9df0eb02..b21a20180f 100644 --- a/vendor/golang.org/x/crypto/ssh/agent/server.go +++ b/vendor/golang.org/x/crypto/ssh/agent/server.go @@ -167,7 +167,7 @@ func (s *server) insertIdentity(req []byte) error { } priv.Precompute() - return s.agent.Add(&priv, nil, k.Comments) + return s.agent.Add(AddedKey{PrivateKey: &priv, Comment: k.Comments}) } return fmt.Errorf("not implemented: %s", record.Type) } diff --git a/vendor/golang.org/x/crypto/ssh/certs.go b/vendor/golang.org/x/crypto/ssh/certs.go index 9962ff0f3d..385770036a 100644 --- a/vendor/golang.org/x/crypto/ssh/certs.go +++ b/vendor/golang.org/x/crypto/ssh/certs.go @@ -85,46 +85,73 @@ func marshalStringList(namelist []string) []byte { return to } +type optionsTuple struct { + Key string + Value []byte +} + +type optionsTupleValue struct { + Value string +} + +// serialize a map of critical options or extensions +// issue #10569 - per [PROTOCOL.certkeys] and SSH implementation, +// we need two length prefixes for a non-empty string value func marshalTuples(tups map[string]string) []byte { keys := make([]string, 0, len(tups)) - for k := range tups { - keys = append(keys, k) + for key := range tups { + keys = append(keys, key) } sort.Strings(keys) - var r []byte - for _, k := range keys { - s := struct{ K, V string }{k, tups[k]} - r = append(r, Marshal(&s)...) + var ret []byte + for _, key := range keys { + s := optionsTuple{Key: key} + if value := tups[key]; len(value) > 0 { + s.Value = Marshal(&optionsTupleValue{value}) + } + ret = append(ret, Marshal(&s)...) } - return r + return ret } +// issue #10569 - per [PROTOCOL.certkeys] and SSH implementation, +// we need two length prefixes for a non-empty option value func parseTuples(in []byte) (map[string]string, error) { tups := map[string]string{} var lastKey string var haveLastKey bool for len(in) > 0 { - nameBytes, rest, ok := parseString(in) - if !ok { - return nil, errShortRead - } - data, rest, ok := parseString(rest) - if !ok { - return nil, errShortRead - } - name := string(nameBytes) + var key, val, extra []byte + var ok bool + if key, in, ok = parseString(in); !ok { + return nil, errShortRead + } + keyStr := string(key) // according to [PROTOCOL.certkeys], the names must be in // lexical order. - if haveLastKey && name <= lastKey { + if haveLastKey && keyStr <= lastKey { return nil, fmt.Errorf("ssh: certificate options are not in lexical order") } - lastKey, haveLastKey = name, true - - tups[name] = string(data) - in = rest + lastKey, haveLastKey = keyStr, true + // the next field is a data field, which if non-empty has a string embedded + if val, in, ok = parseString(in); !ok { + return nil, errShortRead + } + if len(val) > 0 { + val, extra, ok = parseString(val) + if !ok { + return nil, errShortRead + } + if len(extra) > 0 { + return nil, fmt.Errorf("ssh: unexpected trailing data after certificate option value") + } + tups[keyStr] = string(val) + } else { + tups[keyStr] = "" + } } return tups, nil } @@ -341,7 +368,7 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { if after := int64(cert.ValidAfter); after < 0 || unixNow < int64(cert.ValidAfter) { return fmt.Errorf("ssh: cert is not yet valid") } - if before := int64(cert.ValidBefore); cert.ValidBefore != CertTimeInfinity && (unixNow >= before || before < 0) { + if before := int64(cert.ValidBefore); cert.ValidBefore != uint64(CertTimeInfinity) && (unixNow >= before || before < 0) { return fmt.Errorf("ssh: cert has expired") } if err := cert.SignatureKey.Verify(cert.bytesForSigning(), cert.Signature); err != nil { diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index 642696bbbb..3e06da0dec 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -14,6 +14,7 @@ import ( "fmt" "hash" "io" + "io/ioutil" ) const ( @@ -113,6 +114,10 @@ var cipherModes = map[string]*streamCipherMode{ // special case. If we add any more non-stream ciphers, we // should invest a cleaner way to do this. gcmCipherID: {16, 12, 0, nil}, + + // insecure cipher, see http://www.isg.rhul.ac.uk/~kp/SandPfinal.pdf + // uncomment below to enable it. + // aes128cbcID: {16, aes.BlockSize, 0, nil}, } // prefixLen is the length of the packet prefix that contains the packet length @@ -342,3 +347,203 @@ func (c *gcmCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { plain = plain[1 : length-uint32(padding)] return plain, nil } + +// cbcCipher implements aes128-cbc cipher defined in RFC 4253 section 6.1 +type cbcCipher struct { + mac hash.Hash + macSize uint32 + decrypter cipher.BlockMode + encrypter cipher.BlockMode + + // The following members are to avoid per-packet allocations. + seqNumBytes [4]byte + packetData []byte + macResult []byte + + // Amount of data we should still read to hide which + // verification error triggered. + oracleCamouflage uint32 +} + +func newAESCBCCipher(iv, key, macKey []byte, algs directionAlgorithms) (packetCipher, error) { + c, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + + cbc := &cbcCipher{ + mac: macModes[algs.MAC].new(macKey), + decrypter: cipher.NewCBCDecrypter(c, iv), + encrypter: cipher.NewCBCEncrypter(c, iv), + packetData: make([]byte, 1024), + } + if cbc.mac != nil { + cbc.macSize = uint32(cbc.mac.Size()) + } + + return cbc, nil +} + +func maxUInt32(a, b int) uint32 { + if a > b { + return uint32(a) + } + return uint32(b) +} + +const ( + cbcMinPacketSizeMultiple = 8 + cbcMinPacketSize = 16 + cbcMinPaddingSize = 4 +) + +// cbcError represents a verification error that may leak information. +type cbcError string + +func (e cbcError) Error() string { return string(e) } + +func (c *cbcCipher) readPacket(seqNum uint32, r io.Reader) ([]byte, error) { + p, err := c.readPacketLeaky(seqNum, r) + if err != nil { + if _, ok := err.(cbcError); ok { + // Verification error: read a fixed amount of + // data, to make distinguishing between + // failing MAC and failing length check more + // difficult. + io.CopyN(ioutil.Discard, r, int64(c.oracleCamouflage)) + } + } + return p, err +} + +func (c *cbcCipher) readPacketLeaky(seqNum uint32, r io.Reader) ([]byte, error) { + blockSize := c.decrypter.BlockSize() + + // Read the header, which will include some of the subsequent data in the + // case of block ciphers - this is copied back to the payload later. + // How many bytes of payload/padding will be read with this first read. + firstBlockLength := uint32((prefixLen + blockSize - 1) / blockSize * blockSize) + firstBlock := c.packetData[:firstBlockLength] + if _, err := io.ReadFull(r, firstBlock); err != nil { + return nil, err + } + + c.oracleCamouflage = maxPacket + 4 + c.macSize - firstBlockLength + + c.decrypter.CryptBlocks(firstBlock, firstBlock) + length := binary.BigEndian.Uint32(firstBlock[:4]) + if length > maxPacket { + return nil, cbcError("ssh: packet too large") + } + if length+4 < maxUInt32(cbcMinPacketSize, blockSize) { + // The minimum size of a packet is 16 (or the cipher block size, whichever + // is larger) bytes. + return nil, cbcError("ssh: packet too small") + } + // The length of the packet (including the length field but not the MAC) must + // be a multiple of the block size or 8, whichever is larger. + if (length+4)%maxUInt32(cbcMinPacketSizeMultiple, blockSize) != 0 { + return nil, cbcError("ssh: invalid packet length multiple") + } + + paddingLength := uint32(firstBlock[4]) + if paddingLength < cbcMinPaddingSize || length <= paddingLength+1 { + return nil, cbcError("ssh: invalid packet length") + } + + // Positions within the c.packetData buffer: + macStart := 4 + length + paddingStart := macStart - paddingLength + + // Entire packet size, starting before length, ending at end of mac. + entirePacketSize := macStart + c.macSize + + // Ensure c.packetData is large enough for the entire packet data. + if uint32(cap(c.packetData)) < entirePacketSize { + // Still need to upsize and copy, but this should be rare at runtime, only + // on upsizing the packetData buffer. + c.packetData = make([]byte, entirePacketSize) + copy(c.packetData, firstBlock) + } else { + c.packetData = c.packetData[:entirePacketSize] + } + + if n, err := io.ReadFull(r, c.packetData[firstBlockLength:]); err != nil { + return nil, err + } else { + c.oracleCamouflage -= uint32(n) + } + + remainingCrypted := c.packetData[firstBlockLength:macStart] + c.decrypter.CryptBlocks(remainingCrypted, remainingCrypted) + + mac := c.packetData[macStart:] + if c.mac != nil { + c.mac.Reset() + binary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum) + c.mac.Write(c.seqNumBytes[:]) + c.mac.Write(c.packetData[:macStart]) + c.macResult = c.mac.Sum(c.macResult[:0]) + if subtle.ConstantTimeCompare(c.macResult, mac) != 1 { + return nil, cbcError("ssh: MAC failure") + } + } + + return c.packetData[prefixLen:paddingStart], nil +} + +func (c *cbcCipher) writePacket(seqNum uint32, w io.Writer, rand io.Reader, packet []byte) error { + effectiveBlockSize := maxUInt32(cbcMinPacketSizeMultiple, c.encrypter.BlockSize()) + + // Length of encrypted portion of the packet (header, payload, padding). + // Enforce minimum padding and packet size. + encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPaddingSize) + // Enforce block size. + encLength = (encLength + effectiveBlockSize - 1) / effectiveBlockSize * effectiveBlockSize + + length := encLength - 4 + paddingLength := int(length) - (1 + len(packet)) + + // Overall buffer contains: header, payload, padding, mac. + // Space for the MAC is reserved in the capacity but not the slice length. + bufferSize := encLength + c.macSize + if uint32(cap(c.packetData)) < bufferSize { + c.packetData = make([]byte, encLength, bufferSize) + } else { + c.packetData = c.packetData[:encLength] + } + + p := c.packetData + + // Packet header. + binary.BigEndian.PutUint32(p, length) + p = p[4:] + p[0] = byte(paddingLength) + + // Payload. + p = p[1:] + copy(p, packet) + + // Padding. + p = p[len(packet):] + if _, err := io.ReadFull(rand, p); err != nil { + return err + } + + if c.mac != nil { + c.mac.Reset() + binary.BigEndian.PutUint32(c.seqNumBytes[:], seqNum) + c.mac.Write(c.seqNumBytes[:]) + c.mac.Write(c.packetData) + // The MAC is now appended into the capacity reserved for it earlier. + c.packetData = c.mac.Sum(c.packetData) + } + + c.encrypter.CryptBlocks(c.packetData[:encLength], c.packetData[:encLength]) + + if _, err := w.Write(c.packetData); err != nil { + return err + } + + return nil +} diff --git a/vendor/golang.org/x/crypto/ssh/client.go b/vendor/golang.org/x/crypto/ssh/client.go index 03c4e77d4d..0b9fbe5002 100644 --- a/vendor/golang.org/x/crypto/ssh/client.go +++ b/vendor/golang.org/x/crypto/ssh/client.go @@ -82,11 +82,11 @@ func NewClientConn(c net.Conn, addr string, config *ClientConfig) (Conn, <-chan // clientHandshake performs the client side key exchange. See RFC 4253 Section // 7. func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) error { - c.clientVersion = []byte(packageVersion) if config.ClientVersion != "" { c.clientVersion = []byte(config.ClientVersion) + } else { + c.clientVersion = []byte(packageVersion) } - var err error c.serverVersion, err = exchangeVersions(c.sshConn.conn, c.clientVersion) if err != nil { @@ -105,6 +105,10 @@ func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) e } else if packet[0] != msgNewKeys { return unexpectedMessageError(msgNewKeys, packet[0]) } + + // We just did the key change, so the session ID is established. + c.sessionID = c.transport.getSessionID() + return c.clientAuthenticate(config) } @@ -199,4 +203,11 @@ type ClientConfig struct { // ClientVersion contains the version identification string that will // be used for the connection. If empty, a reasonable default is used. ClientVersion string + + // HostKeyAlgorithms lists the key types that the client will + // accept from the server as host key, in order of + // preference. If empty, a reasonable default is used. Any + // string returned from PublicKey.Type method may be used, or + // any of the CertAlgoXxxx and KeyAlgoXxxx constants. + HostKeyAlgorithms []string } diff --git a/vendor/golang.org/x/crypto/ssh/common.go b/vendor/golang.org/x/crypto/ssh/common.go index 2fd7fd9270..9fc739e1d0 100644 --- a/vendor/golang.org/x/crypto/ssh/common.go +++ b/vendor/golang.org/x/crypto/ssh/common.go @@ -33,6 +33,7 @@ var supportedCiphers = []string{ // supportedKexAlgos specifies the supported key-exchange algorithms in // preference order. var supportedKexAlgos = []string{ + kexAlgoCurve25519SHA256, // P384 and P521 are not constant-time yet, but since we don't // reuse ephemeral keys, using them for ECDH should be OK. kexAlgoECDH256, kexAlgoECDH384, kexAlgoECDH521, @@ -53,7 +54,7 @@ var supportedHostKeyAlgos = []string{ // This is based on RFC 4253, section 6.4, but with hmac-md5 variants removed // because they have reached the end of their useful life. var supportedMACs = []string{ - "hmac-sha1", "hmac-sha1-96", + "hmac-sha2-256", "hmac-sha1", "hmac-sha1-96", } var supportedCompressions = []string{compressionNone} @@ -84,27 +85,15 @@ func parseError(tag uint8) error { return fmt.Errorf("ssh: parse error in message type %d", tag) } -func findCommonAlgorithm(clientAlgos []string, serverAlgos []string) (commonAlgo string, ok bool) { - for _, clientAlgo := range clientAlgos { - for _, serverAlgo := range serverAlgos { - if clientAlgo == serverAlgo { - return clientAlgo, true +func findCommon(what string, client []string, server []string) (common string, err error) { + for _, c := range client { + for _, s := range server { + if c == s { + return c, nil } } } - return -} - -func findCommonCipher(clientCiphers []string, serverCiphers []string) (commonCipher string, ok bool) { - for _, clientCipher := range clientCiphers { - for _, serverCipher := range serverCiphers { - // reject the cipher if we have no cipherModes definition - if clientCipher == serverCipher && cipherModes[clientCipher] != nil { - return clientCipher, true - } - } - } - return + return "", fmt.Errorf("ssh: no common algorithm for %s; client offered: %v, server offered: %v", what, client, server) } type directionAlgorithms struct { @@ -120,50 +109,50 @@ type algorithms struct { r directionAlgorithms } -func findAgreedAlgorithms(clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms) { - var ok bool +func findAgreedAlgorithms(clientKexInit, serverKexInit *kexInitMsg) (algs *algorithms, err error) { result := &algorithms{} - result.kex, ok = findCommonAlgorithm(clientKexInit.KexAlgos, serverKexInit.KexAlgos) - if !ok { + + result.kex, err = findCommon("key exchange", clientKexInit.KexAlgos, serverKexInit.KexAlgos) + if err != nil { return } - result.hostKey, ok = findCommonAlgorithm(clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) - if !ok { + result.hostKey, err = findCommon("host key", clientKexInit.ServerHostKeyAlgos, serverKexInit.ServerHostKeyAlgos) + if err != nil { return } - result.w.Cipher, ok = findCommonCipher(clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer) - if !ok { + result.w.Cipher, err = findCommon("client to server cipher", clientKexInit.CiphersClientServer, serverKexInit.CiphersClientServer) + if err != nil { return } - result.r.Cipher, ok = findCommonCipher(clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient) - if !ok { + result.r.Cipher, err = findCommon("server to client cipher", clientKexInit.CiphersServerClient, serverKexInit.CiphersServerClient) + if err != nil { return } - result.w.MAC, ok = findCommonAlgorithm(clientKexInit.MACsClientServer, serverKexInit.MACsClientServer) - if !ok { + result.w.MAC, err = findCommon("client to server MAC", clientKexInit.MACsClientServer, serverKexInit.MACsClientServer) + if err != nil { return } - result.r.MAC, ok = findCommonAlgorithm(clientKexInit.MACsServerClient, serverKexInit.MACsServerClient) - if !ok { + result.r.MAC, err = findCommon("server to client MAC", clientKexInit.MACsServerClient, serverKexInit.MACsServerClient) + if err != nil { return } - result.w.Compression, ok = findCommonAlgorithm(clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) - if !ok { + result.w.Compression, err = findCommon("client to server compression", clientKexInit.CompressionClientServer, serverKexInit.CompressionClientServer) + if err != nil { return } - result.r.Compression, ok = findCommonAlgorithm(clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) - if !ok { + result.r.Compression, err = findCommon("server to client compression", clientKexInit.CompressionServerClient, serverKexInit.CompressionServerClient) + if err != nil { return } - return result + return result, nil } // If rekeythreshold is too small, we can't make any progress sending @@ -206,6 +195,14 @@ func (c *Config) SetDefaults() { if c.Ciphers == nil { c.Ciphers = supportedCiphers } + var ciphers []string + for _, c := range c.Ciphers { + if cipherModes[c] != nil { + // reject the cipher if we have no cipherModes definition + ciphers = append(ciphers, c) + } + } + c.Ciphers = ciphers if c.KeyExchanges == nil { c.KeyExchanges = supportedKexAlgos diff --git a/vendor/golang.org/x/crypto/ssh/connection.go b/vendor/golang.org/x/crypto/ssh/connection.go index 93551e241f..979d919e81 100644 --- a/vendor/golang.org/x/crypto/ssh/connection.go +++ b/vendor/golang.org/x/crypto/ssh/connection.go @@ -33,7 +33,7 @@ type ConnMetadata interface { // into the session ID. ClientVersion() []byte - // ServerVersion returns the client's version string as hashed + // ServerVersion returns the server's version string as hashed // into the session ID. ServerVersion() []byte diff --git a/vendor/golang.org/x/crypto/ssh/doc.go b/vendor/golang.org/x/crypto/ssh/doc.go index d4d16f08de..a5ff8af6b2 100644 --- a/vendor/golang.org/x/crypto/ssh/doc.go +++ b/vendor/golang.org/x/crypto/ssh/doc.go @@ -12,7 +12,7 @@ the multiplexed nature of SSH is exposed to users that wish to support others. References: - [PROTOCOL.certkeys]: http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys + [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 */ package ssh diff --git a/vendor/golang.org/x/crypto/ssh/handshake.go b/vendor/golang.org/x/crypto/ssh/handshake.go index a1e2c23dad..1c54f75878 100644 --- a/vendor/golang.org/x/crypto/ssh/handshake.go +++ b/vendor/golang.org/x/crypto/ssh/handshake.go @@ -59,7 +59,14 @@ type handshakeTransport struct { serverVersion []byte clientVersion []byte - hostKeys []Signer // If hostKeys are given, we are the server. + // hostKeys is non-empty if we are the server. In that case, + // it contains all host keys that can be used to sign the + // connection. + hostKeys []Signer + + // hostKeyAlgorithms is non-empty if we are the client. In that case, + // we accept these key types from the server as host key. + hostKeyAlgorithms []string // On read error, incoming is closed, and readError is set. incoming chan []byte @@ -98,6 +105,11 @@ func newClientTransport(conn keyingTransport, clientVersion, serverVersion []byt t.dialAddress = dialAddr t.remoteAddr = addr t.hostKeyCallback = config.HostKeyCallback + if config.HostKeyAlgorithms != nil { + t.hostKeyAlgorithms = config.HostKeyAlgorithms + } else { + t.hostKeyAlgorithms = supportedHostKeyAlgos + } go t.readLoop() return t } @@ -141,6 +153,14 @@ func (t *handshakeTransport) readLoop() { } t.incoming <- p } + + // If we can't read, declare the writing part dead too. + t.mu.Lock() + defer t.mu.Unlock() + if t.writeError == nil { + t.writeError = t.readError + } + t.cond.Broadcast() } func (t *handshakeTransport) readOnePacket() ([]byte, error) { @@ -234,7 +254,7 @@ func (t *handshakeTransport) sendKexInitLocked() (*kexInitMsg, []byte, error) { msg.ServerHostKeyAlgos, k.PublicKey().Type()) } } else { - msg.ServerHostKeyAlgos = supportedHostKeyAlgos + msg.ServerHostKeyAlgos = t.hostKeyAlgorithms } packet := Marshal(msg) @@ -253,10 +273,12 @@ func (t *handshakeTransport) sendKexInitLocked() (*kexInitMsg, []byte, error) { func (t *handshakeTransport) writePacket(p []byte) error { t.mu.Lock() + defer t.mu.Unlock() + if t.writtenSinceKex > t.config.RekeyThreshold { t.sendKexInitLocked() } - for t.sentInitMsg != nil { + for t.sentInitMsg != nil && t.writeError == nil { t.cond.Wait() } if t.writeError != nil { @@ -264,17 +286,14 @@ func (t *handshakeTransport) writePacket(p []byte) error { } t.writtenSinceKex += uint64(len(p)) - var err error switch p[0] { case msgKexInit: - err = errors.New("ssh: only handshakeTransport can send kexInit") + return errors.New("ssh: only handshakeTransport can send kexInit") case msgNewKeys: - err = errors.New("ssh: only handshakeTransport can send newKeys") + return errors.New("ssh: only handshakeTransport can send newKeys") default: - err = t.conn.writePacket(p) + return t.conn.writePacket(p) } - t.mu.Unlock() - return err } func (t *handshakeTransport) Close() error { @@ -313,9 +332,9 @@ func (t *handshakeTransport) enterKeyExchange(otherInitPacket []byte) error { magics.serverKexInit = otherInitPacket } - algs := findAgreedAlgorithms(clientInit, serverInit) - if algs == nil { - return errors.New("ssh: no common algorithms") + algs, err := findAgreedAlgorithms(clientInit, serverInit) + if err != nil { + return err } // We don't send FirstKexFollows, but we handle receiving it. diff --git a/vendor/golang.org/x/crypto/ssh/kex.go b/vendor/golang.org/x/crypto/ssh/kex.go index 6a835c7630..ea19d537fd 100644 --- a/vendor/golang.org/x/crypto/ssh/kex.go +++ b/vendor/golang.org/x/crypto/ssh/kex.go @@ -8,18 +8,22 @@ import ( "crypto" "crypto/ecdsa" "crypto/elliptic" + "crypto/subtle" "crypto/rand" "errors" "io" "math/big" + + "golang.org/x/crypto/curve25519" ) const ( - kexAlgoDH1SHA1 = "diffie-hellman-group1-sha1" - kexAlgoDH14SHA1 = "diffie-hellman-group14-sha1" - kexAlgoECDH256 = "ecdh-sha2-nistp256" - kexAlgoECDH384 = "ecdh-sha2-nistp384" - kexAlgoECDH521 = "ecdh-sha2-nistp521" + kexAlgoDH1SHA1 = "diffie-hellman-group1-sha1" + kexAlgoDH14SHA1 = "diffie-hellman-group14-sha1" + kexAlgoECDH256 = "ecdh-sha2-nistp256" + kexAlgoECDH384 = "ecdh-sha2-nistp384" + kexAlgoECDH521 = "ecdh-sha2-nistp521" + kexAlgoCurve25519SHA256 = "curve25519-sha256@libssh.org" ) // kexResult captures the outcome of a key exchange. @@ -383,4 +387,140 @@ func init() { kexAlgoMap[kexAlgoECDH521] = &ecdh{elliptic.P521()} kexAlgoMap[kexAlgoECDH384] = &ecdh{elliptic.P384()} kexAlgoMap[kexAlgoECDH256] = &ecdh{elliptic.P256()} + kexAlgoMap[kexAlgoCurve25519SHA256] = &curve25519sha256{} +} + +// curve25519sha256 implements the curve25519-sha256@libssh.org key +// agreement protocol, as described in +// https://git.libssh.org/projects/libssh.git/tree/doc/curve25519-sha256@libssh.org.txt +type curve25519sha256 struct{} + +type curve25519KeyPair struct { + priv [32]byte + pub [32]byte +} + +func (kp *curve25519KeyPair) generate(rand io.Reader) error { + if _, err := io.ReadFull(rand, kp.priv[:]); err != nil { + return err + } + curve25519.ScalarBaseMult(&kp.pub, &kp.priv) + return nil +} + +// curve25519Zeros is just an array of 32 zero bytes so that we have something +// convenient to compare against in order to reject curve25519 points with the +// wrong order. +var curve25519Zeros [32]byte + +func (kex *curve25519sha256) Client(c packetConn, rand io.Reader, magics *handshakeMagics) (*kexResult, error) { + var kp curve25519KeyPair + if err := kp.generate(rand); err != nil { + return nil, err + } + if err := c.writePacket(Marshal(&kexECDHInitMsg{kp.pub[:]})); err != nil { + return nil, err + } + + packet, err := c.readPacket() + if err != nil { + return nil, err + } + + var reply kexECDHReplyMsg + if err = Unmarshal(packet, &reply); err != nil { + return nil, err + } + if len(reply.EphemeralPubKey) != 32 { + return nil, errors.New("ssh: peer's curve25519 public value has wrong length") + } + + var servPub, secret [32]byte + copy(servPub[:], reply.EphemeralPubKey) + curve25519.ScalarMult(&secret, &kp.priv, &servPub) + if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 { + return nil, errors.New("ssh: peer's curve25519 public value has wrong order") + } + + h := crypto.SHA256.New() + magics.write(h) + writeString(h, reply.HostKey) + writeString(h, kp.pub[:]) + writeString(h, reply.EphemeralPubKey) + + kInt := new(big.Int).SetBytes(secret[:]) + K := make([]byte, intLength(kInt)) + marshalInt(K, kInt) + h.Write(K) + + return &kexResult{ + H: h.Sum(nil), + K: K, + HostKey: reply.HostKey, + Signature: reply.Signature, + Hash: crypto.SHA256, + }, nil +} + +func (kex *curve25519sha256) Server(c packetConn, rand io.Reader, magics *handshakeMagics, priv Signer) (result *kexResult, err error) { + packet, err := c.readPacket() + if err != nil { + return + } + var kexInit kexECDHInitMsg + if err = Unmarshal(packet, &kexInit); err != nil { + return + } + + if len(kexInit.ClientPubKey) != 32 { + return nil, errors.New("ssh: peer's curve25519 public value has wrong length") + } + + var kp curve25519KeyPair + if err := kp.generate(rand); err != nil { + return nil, err + } + + var clientPub, secret [32]byte + copy(clientPub[:], kexInit.ClientPubKey) + curve25519.ScalarMult(&secret, &kp.priv, &clientPub) + if subtle.ConstantTimeCompare(secret[:], curve25519Zeros[:]) == 1 { + return nil, errors.New("ssh: peer's curve25519 public value has wrong order") + } + + hostKeyBytes := priv.PublicKey().Marshal() + + h := crypto.SHA256.New() + magics.write(h) + writeString(h, hostKeyBytes) + writeString(h, kexInit.ClientPubKey) + writeString(h, kp.pub[:]) + + kInt := new(big.Int).SetBytes(secret[:]) + K := make([]byte, intLength(kInt)) + marshalInt(K, kInt) + h.Write(K) + + H := h.Sum(nil) + + sig, err := signAndMarshal(priv, rand, H) + if err != nil { + return nil, err + } + + reply := kexECDHReplyMsg{ + EphemeralPubKey: kp.pub[:], + HostKey: hostKeyBytes, + Signature: sig, + } + if err := c.writePacket(Marshal(&reply)); err != nil { + return nil, err + } + return &kexResult{ + H: H, + K: K, + HostKey: hostKeyBytes, + Signature: sig, + Hash: crypto.SHA256, + }, nil } diff --git a/vendor/golang.org/x/crypto/ssh/keys.go b/vendor/golang.org/x/crypto/ssh/keys.go index e8af511eeb..8ce4185853 100644 --- a/vendor/golang.org/x/crypto/ssh/keys.go +++ b/vendor/golang.org/x/crypto/ssh/keys.go @@ -267,28 +267,6 @@ func (r *rsaPublicKey) Verify(data []byte, sig *Signature) error { return rsa.VerifyPKCS1v15((*rsa.PublicKey)(r), crypto.SHA1, digest, sig.Blob) } -type rsaPrivateKey struct { - *rsa.PrivateKey -} - -func (r *rsaPrivateKey) PublicKey() PublicKey { - return (*rsaPublicKey)(&r.PrivateKey.PublicKey) -} - -func (r *rsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) { - h := crypto.SHA1.New() - h.Write(data) - digest := h.Sum(nil) - blob, err := rsa.SignPKCS1v15(rand, r.PrivateKey, crypto.SHA1, digest) - if err != nil { - return nil, err - } - return &Signature{ - Format: r.PublicKey().Type(), - Blob: blob, - }, nil -} - type dsaPublicKey dsa.PublicKey func (r *dsaPublicKey) Type() string { @@ -422,14 +400,19 @@ func ecHash(curve elliptic.Curve) crypto.Hash { // parseECDSA parses an ECDSA key according to RFC 5656, section 3.1. func parseECDSA(in []byte) (out PublicKey, rest []byte, err error) { - identifier, in, ok := parseString(in) - if !ok { - return nil, nil, errShortRead + var w struct { + Curve string + KeyBytes []byte + Rest []byte `ssh:"rest"` + } + + if err := Unmarshal(in, &w); err != nil { + return nil, nil, err } key := new(ecdsa.PublicKey) - switch string(identifier) { + switch w.Curve { case "nistp256": key.Curve = elliptic.P256() case "nistp384": @@ -440,16 +423,11 @@ func parseECDSA(in []byte) (out PublicKey, rest []byte, err error) { return nil, nil, errors.New("ssh: unsupported curve") } - var keyBytes []byte - if keyBytes, in, ok = parseString(in); !ok { - return nil, nil, errShortRead - } - - key.X, key.Y = elliptic.Unmarshal(key.Curve, keyBytes) + key.X, key.Y = elliptic.Unmarshal(key.Curve, w.KeyBytes) if key.X == nil || key.Y == nil { return nil, nil, errors.New("ssh: invalid curve point") } - return (*ecdsaPublicKey)(key), in, nil + return (*ecdsaPublicKey)(key), w.Rest, nil } func (key *ecdsaPublicKey) Marshal() []byte { @@ -496,72 +474,112 @@ func (key *ecdsaPublicKey) Verify(data []byte, sig *Signature) error { return errors.New("ssh: signature did not verify") } -type ecdsaPrivateKey struct { - *ecdsa.PrivateKey +// NewSignerFromKey takes an *rsa.PrivateKey, *dsa.PrivateKey, +// *ecdsa.PrivateKey or any other crypto.Signer and returns a corresponding +// Signer instance. ECDSA keys must use P-256, P-384 or P-521. +func NewSignerFromKey(key interface{}) (Signer, error) { + switch key := key.(type) { + case crypto.Signer: + return NewSignerFromSigner(key) + case *dsa.PrivateKey: + return &dsaPrivateKey{key}, nil + default: + return nil, fmt.Errorf("ssh: unsupported key type %T", key) + } } -func (k *ecdsaPrivateKey) PublicKey() PublicKey { - return (*ecdsaPublicKey)(&k.PrivateKey.PublicKey) +type wrappedSigner struct { + signer crypto.Signer + pubKey PublicKey } -func (k *ecdsaPrivateKey) Sign(rand io.Reader, data []byte) (*Signature, error) { - h := ecHash(k.PrivateKey.PublicKey.Curve).New() - h.Write(data) - digest := h.Sum(nil) - r, s, err := ecdsa.Sign(rand, k.PrivateKey, digest) +// NewSignerFromSigner takes any crypto.Signer implementation and +// returns a corresponding Signer interface. This can be used, for +// example, with keys kept in hardware modules. +func NewSignerFromSigner(signer crypto.Signer) (Signer, error) { + pubKey, err := NewPublicKey(signer.Public()) if err != nil { return nil, err } - sig := make([]byte, intLength(r)+intLength(s)) - rest := marshalInt(sig, r) - marshalInt(rest, s) + return &wrappedSigner{signer, pubKey}, nil +} + +func (s *wrappedSigner) PublicKey() PublicKey { + return s.pubKey +} + +func (s *wrappedSigner) Sign(rand io.Reader, data []byte) (*Signature, error) { + var hashFunc crypto.Hash + + switch key := s.pubKey.(type) { + case *rsaPublicKey, *dsaPublicKey: + hashFunc = crypto.SHA1 + case *ecdsaPublicKey: + hashFunc = ecHash(key.Curve) + default: + return nil, fmt.Errorf("ssh: unsupported key type %T", key) + } + + h := hashFunc.New() + h.Write(data) + digest := h.Sum(nil) + + signature, err := s.signer.Sign(rand, digest, hashFunc) + if err != nil { + return nil, err + } + + // crypto.Signer.Sign is expected to return an ASN.1-encoded signature + // for ECDSA and DSA, but that's not the encoding expected by SSH, so + // re-encode. + switch s.pubKey.(type) { + case *ecdsaPublicKey, *dsaPublicKey: + type asn1Signature struct { + R, S *big.Int + } + asn1Sig := new(asn1Signature) + _, err := asn1.Unmarshal(signature, asn1Sig) + if err != nil { + return nil, err + } + + switch s.pubKey.(type) { + case *ecdsaPublicKey: + signature = Marshal(asn1Sig) + + case *dsaPublicKey: + signature = make([]byte, 40) + r := asn1Sig.R.Bytes() + s := asn1Sig.S.Bytes() + copy(signature[20-len(r):20], r) + copy(signature[40-len(s):40], s) + } + } + return &Signature{ - Format: k.PublicKey().Type(), - Blob: sig, + Format: s.pubKey.Type(), + Blob: signature, }, nil } -// NewSignerFromKey takes a pointer to rsa, dsa or ecdsa PrivateKey -// returns a corresponding Signer instance. EC keys should use P256, -// P384 or P521. -func NewSignerFromKey(k interface{}) (Signer, error) { - var sshKey Signer - switch t := k.(type) { - case *rsa.PrivateKey: - sshKey = &rsaPrivateKey{t} - case *dsa.PrivateKey: - sshKey = &dsaPrivateKey{t} - case *ecdsa.PrivateKey: - if !supportedEllipticCurve(t.Curve) { - return nil, errors.New("ssh: only P256, P384 and P521 EC keys are supported.") - } - - sshKey = &ecdsaPrivateKey{t} - default: - return nil, fmt.Errorf("ssh: unsupported key type %T", k) - } - return sshKey, nil -} - -// NewPublicKey takes a pointer to rsa, dsa or ecdsa PublicKey -// and returns a corresponding ssh PublicKey instance. EC keys should use P256, P384 or P521. -func NewPublicKey(k interface{}) (PublicKey, error) { - var sshKey PublicKey - switch t := k.(type) { +// NewPublicKey takes an *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey or +// any other crypto.Signer and returns a corresponding Signer instance. ECDSA +// keys must use P-256, P-384 or P-521. +func NewPublicKey(key interface{}) (PublicKey, error) { + switch key := key.(type) { case *rsa.PublicKey: - sshKey = (*rsaPublicKey)(t) + return (*rsaPublicKey)(key), nil case *ecdsa.PublicKey: - if !supportedEllipticCurve(t.Curve) { - return nil, errors.New("ssh: only P256, P384 and P521 EC keys are supported.") + if !supportedEllipticCurve(key.Curve) { + return nil, errors.New("ssh: only P-256, P-384 and P-521 EC keys are supported.") } - sshKey = (*ecdsaPublicKey)(t) + return (*ecdsaPublicKey)(key), nil case *dsa.PublicKey: - sshKey = (*dsaPublicKey)(t) + return (*dsaPublicKey)(key), nil default: - return nil, fmt.Errorf("ssh: unsupported key type %T", k) + return nil, fmt.Errorf("ssh: unsupported key type %T", key) } - return sshKey, nil } // ParsePrivateKey returns a Signer from a PEM encoded private key. It supports diff --git a/vendor/golang.org/x/crypto/ssh/mac.go b/vendor/golang.org/x/crypto/ssh/mac.go index aff4042913..07744ad671 100644 --- a/vendor/golang.org/x/crypto/ssh/mac.go +++ b/vendor/golang.org/x/crypto/ssh/mac.go @@ -9,6 +9,7 @@ package ssh import ( "crypto/hmac" "crypto/sha1" + "crypto/sha256" "hash" ) @@ -44,6 +45,9 @@ func (t truncatingMAC) Size() int { func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } var macModes = map[string]*macMode{ + "hmac-sha2-256": {32, func(key []byte) hash.Hash { + return hmac.New(sha256.New, key) + }}, "hmac-sha1": {20, func(key []byte) hash.Hash { return hmac.New(sha1.New, key) }}, diff --git a/vendor/golang.org/x/crypto/ssh/messages.go b/vendor/golang.org/x/crypto/ssh/messages.go index f9e44bb1eb..eaf6106698 100644 --- a/vendor/golang.org/x/crypto/ssh/messages.go +++ b/vendor/golang.org/x/crypto/ssh/messages.go @@ -484,11 +484,12 @@ func parseString(in []byte) (out, rest []byte, ok bool) { return } length := binary.BigEndian.Uint32(in) - if uint32(len(in)) < 4+length { + in = in[4:] + if uint32(len(in)) < length { return } - out = in[4 : 4+length] - rest = in[4+length:] + out = in[:length] + rest = in[length:] ok = true return } diff --git a/vendor/golang.org/x/crypto/ssh/server.go b/vendor/golang.org/x/crypto/ssh/server.go index 8c4f1429ee..4781eb7805 100644 --- a/vendor/golang.org/x/crypto/ssh/server.go +++ b/vendor/golang.org/x/crypto/ssh/server.go @@ -65,6 +65,13 @@ type ServerConfig struct { // AuthLogCallback, if non-nil, is called to log all authentication // attempts. AuthLogCallback func(conn ConnMetadata, method string, err error) + + // ServerVersion is the version identification string to announce in + // the public handshake. + // If empty, a reasonable default is used. + // Note that RFC 4253 section 4.2 requires that this string start with + // "SSH-2.0-". + ServerVersion string } // AddHostKey adds a private key as a host key. If an existing host @@ -163,8 +170,16 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) return nil, errors.New("ssh: server has no host keys") } + if !config.NoClientAuth && config.PasswordCallback == nil && config.PublicKeyCallback == nil && config.KeyboardInteractiveCallback == nil { + return nil, errors.New("ssh: no authentication methods configured but NoClientAuth is also false") + } + + if config.ServerVersion != "" { + s.serverVersion = []byte(config.ServerVersion) + } else { + s.serverVersion = []byte(packageVersion) + } var err error - s.serverVersion = []byte(packageVersion) s.clientVersion, err = exchangeVersions(s.sshConn.conn, s.serverVersion) if err != nil { return nil, err @@ -183,6 +198,9 @@ func (s *connection) serverHandshake(config *ServerConfig) (*Permissions, error) return nil, unexpectedMessageError(msgNewKeys, packet[0]) } + // We just did the key change, so the session ID is established. + s.sessionID = s.transport.getSessionID() + var packet []byte if packet, err = s.transport.readPacket(); err != nil { return nil, err diff --git a/vendor/golang.org/x/crypto/ssh/session.go b/vendor/golang.org/x/crypto/ssh/session.go index 3b42b508a8..fd10cd1aaf 100644 --- a/vendor/golang.org/x/crypto/ssh/session.go +++ b/vendor/golang.org/x/crypto/ssh/session.go @@ -339,7 +339,7 @@ func (s *Session) Shell() error { ok, err := s.ch.SendRequest("shell", true, nil) if err == nil && !ok { - return fmt.Errorf("ssh: cound not start shell") + return errors.New("ssh: could not start shell") } if err != nil { return err diff --git a/vendor/golang.org/x/crypto/ssh/tcpip.go b/vendor/golang.org/x/crypto/ssh/tcpip.go index 4ecad0b3ff..6151241ff0 100644 --- a/vendor/golang.org/x/crypto/ssh/tcpip.go +++ b/vendor/golang.org/x/crypto/ssh/tcpip.go @@ -355,6 +355,9 @@ func (c *Client) dial(laddr string, lport int, raddr string, rport int) (Channel lport: uint32(lport), } ch, in, err := c.OpenChannel("direct-tcpip", Marshal(&msg)) + if err != nil { + return nil, err + } go DiscardRequests(in) return ch, err } diff --git a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go index 965f0cfcf5..741eeb13f0 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/terminal.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/terminal.go @@ -789,6 +789,10 @@ func (t *Terminal) SetSize(width, height int) error { // If the width didn't change then nothing else needs to be // done. return nil + case len(t.line) == 0 && t.cursorX == 0 && t.cursorY == 0: + // If there is nothing on current line and no prompt printed, + // just do nothing + return nil case width < oldWidth: // Some terminals (e.g. xterm) will truncate lines that were // too long when shinking. Others, (e.g. gnome-terminal) will diff --git a/vendor/golang.org/x/crypto/ssh/test/doc.go b/vendor/golang.org/x/crypto/ssh/test/doc.go index 787b8fa207..29ad65e96c 100644 --- a/vendor/golang.org/x/crypto/ssh/test/doc.go +++ b/vendor/golang.org/x/crypto/ssh/test/doc.go @@ -3,5 +3,5 @@ // license that can be found in the LICENSE file. // This package contains integration tests for the -// code.google.com/p/go.crypto/ssh package. +// golang.org/x/crypto/ssh package. package test diff --git a/vendor/golang.org/x/crypto/ssh/transport.go b/vendor/golang.org/x/crypto/ssh/transport.go index 4f68b0473f..8351d378e7 100644 --- a/vendor/golang.org/x/crypto/ssh/transport.go +++ b/vendor/golang.org/x/crypto/ssh/transport.go @@ -12,6 +12,7 @@ import ( const ( gcmCipherID = "aes128-gcm@openssh.com" + aes128cbcID = "aes128-cbc" ) // packetConn represents a transport that implements packet based @@ -44,13 +45,13 @@ type transport struct { sessionID []byte } +// getSessionID returns the ID of the SSH connection. The return value +// should not be modified. func (t *transport) getSessionID() []byte { if t.sessionID == nil { panic("session ID not set yet") } - s := make([]byte, len(t.sessionID)) - copy(s, t.sessionID) - return s + return t.sessionID } // packetCipher represents a combination of SSH encryption/MAC @@ -218,6 +219,10 @@ func newPacketCipher(d direction, algs directionAlgorithms, kex *kexResult) (pac return newGCMCipher(iv, key, macKey) } + if algs.Cipher == aes128cbcID { + return newAESCBCCipher(iv, key, macKey, algs) + } + c := &streamPacketCipher{ mac: macModes[algs.MAC].new(macKey), } diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go index ef2f3e86fe..11bd8d34e6 100644 --- a/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -189,7 +189,7 @@ func Background() Context { } // TODO returns a non-nil, empty Context. Code should use context.TODO when -// it's unclear which Context to use or it's is not yet available (because the +// it's unclear which Context to use or it is not yet available (because the // surrounding function has not yet been extended to accept a Context // parameter). TODO is recognized by static analysis tools that determine // whether Contexts are propagated correctly in a program. diff --git a/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go b/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go new file mode 100644 index 0000000000..48610e3627 --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/cancelreq.go @@ -0,0 +1,18 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.5 + +package ctxhttp + +import "net/http" + +func canceler(client *http.Client, req *http.Request) func() { + ch := make(chan struct{}) + req.Cancel = ch + + return func() { + close(ch) + } +} diff --git a/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go b/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go new file mode 100644 index 0000000000..56bcbadb85 --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/cancelreq_go14.go @@ -0,0 +1,23 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.5 + +package ctxhttp + +import "net/http" + +type requestCanceler interface { + CancelRequest(*http.Request) +} + +func canceler(client *http.Client, req *http.Request) func() { + rc, ok := client.Transport.(requestCanceler) + if !ok { + return func() {} + } + return func() { + rc.CancelRequest(req) + } +} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go new file mode 100644 index 0000000000..9f34888132 --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go @@ -0,0 +1,79 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package ctxhttp provides helper functions for performing context-aware HTTP requests. +package ctxhttp + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +// Do sends an HTTP request with the provided http.Client and returns an HTTP response. +// If the client is nil, http.DefaultClient is used. +// If the context is canceled or times out, ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + + // Request cancelation changed in Go 1.5, see cancelreq.go and cancelreq_go14.go. + cancel := canceler(client, req) + + type responseAndError struct { + resp *http.Response + err error + } + result := make(chan responseAndError, 1) + + go func() { + resp, err := client.Do(req) + result <- responseAndError{resp, err} + }() + + select { + case <-ctx.Done(): + cancel() + return nil, ctx.Err() + case r := <-result: + return r.resp, r.err + } +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go index 909d52a128..39caf6c617 100644 --- a/vendor/golang.org/x/oauth2/internal/token.go +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -91,25 +91,32 @@ func (e *expirationTime) UnmarshalJSON(b []byte) error { var brokenAuthHeaderProviders = []string{ "https://accounts.google.com/", - "https://www.googleapis.com/", - "https://api.instagram.com/", - "https://www.douban.com/", "https://api.dropbox.com/", - "https://api.soundcloud.com/", - "https://www.linkedin.com/", - "https://api.twitch.tv/", - "https://oauth.vk.com/", + "https://api.instagram.com/", + "https://api.netatmo.net/", "https://api.odnoklassniki.ru/", - "https://connect.stripe.com/", "https://api.pushbullet.com/", + "https://api.soundcloud.com/", + "https://api.twitch.tv/", + "https://app.box.com/", + "https://connect.stripe.com/", + "https://login.microsoftonline.com/", + "https://login.salesforce.com/", "https://oauth.sandbox.trainingpeaks.com/", "https://oauth.trainingpeaks.com/", - "https://www.strava.com/oauth/", - "https://app.box.com/", - "https://test-sandbox.auth.corp.google.com", - "https://user.gini.net/", - "https://api.netatmo.net/", + "https://oauth.vk.com/", "https://slack.com/", + "https://test-sandbox.auth.corp.google.com", + "https://test.salesforce.com/", + "https://user.gini.net/", + "https://www.douban.com/", + "https://www.googleapis.com/", + "https://www.linkedin.com/", + "https://www.strava.com/oauth/", +} + +func RegisterBrokenAuthHeaderProvider(tokenURL string) { + brokenAuthHeaderProviders = append(brokenAuthHeaderProviders, tokenURL) } // providerAuthHeaderWorks reports whether the OAuth2 server identified by the tokenURL diff --git a/vendor/golang.org/x/oauth2/jws/jws.go b/vendor/golang.org/x/oauth2/jws/jws.go index 797e2f3e1e..b46edb27c1 100644 --- a/vendor/golang.org/x/oauth2/jws/jws.go +++ b/vendor/golang.org/x/oauth2/jws/jws.go @@ -119,8 +119,11 @@ func Decode(payload string) (*ClaimSet, error) { return c, err } -// Encode encodes a signed JWS with provided header and claim set. -func Encode(header *Header, c *ClaimSet, signature *rsa.PrivateKey) (string, error) { +// Signer returns a signature for the given data. +type Signer func(data []byte) (sig []byte, err error) + +// EncodeWithSigner encodes a header and claim set with the provided signer. +func EncodeWithSigner(header *Header, c *ClaimSet, sg Signer) (string, error) { head, err := header.encode() if err != nil { return "", err @@ -130,14 +133,22 @@ func Encode(header *Header, c *ClaimSet, signature *rsa.PrivateKey) (string, err return "", err } ss := fmt.Sprintf("%s.%s", head, cs) - h := sha256.New() - h.Write([]byte(ss)) - b, err := rsa.SignPKCS1v15(rand.Reader, signature, crypto.SHA256, h.Sum(nil)) + sig, err := sg([]byte(ss)) if err != nil { return "", err } - sig := base64Encode(b) - return fmt.Sprintf("%s.%s", ss, sig), nil + return fmt.Sprintf("%s.%s", ss, base64Encode(sig)), nil +} + +// Encode encodes a signed JWS with provided header and claim set. +// This invokes EncodeWithSigner using crypto/rsa.SignPKCS1v15 with the given RSA private key. +func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error) { + sg := func(data []byte) (sig []byte, err error) { + h := sha256.New() + h.Write([]byte(data)) + return rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, h.Sum(nil)) + } + return EncodeWithSigner(header, c, sg) } // base64Encode returns and Base64url encoded version of the input string with any @@ -150,6 +161,8 @@ func base64Encode(b []byte) string { func base64Decode(s string) ([]byte, error) { // add back missing padding switch len(s) % 4 { + case 1: + s += "===" case 2: s += "==" case 3: diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go index b349276e6c..9b7b977dab 100644 --- a/vendor/golang.org/x/oauth2/oauth2.go +++ b/vendor/golang.org/x/oauth2/oauth2.go @@ -23,6 +23,18 @@ import ( // your own context.Context (see https://golang.org/x/net/context). var NoContext = context.TODO() +// RegisterBrokenAuthHeaderProvider registers an OAuth2 server +// identified by the tokenURL prefix as an OAuth2 implementation +// which doesn't support the HTTP Basic authentication +// scheme to authenticate with the authorization server. +// Once a server is registered, credentials (client_id and client_secret) +// will be passed as query parameters rather than being present +// in the Authorization header. +// See https://code.google.com/p/goauth2/issues/detail?id=31 for background. +func RegisterBrokenAuthHeaderProvider(tokenURL string) { + internal.RegisterBrokenAuthHeaderProvider(tokenURL) +} + // Config describes a typical 3-legged OAuth2 flow, with both the // client application information and the server's endpoint URLs. type Config struct { 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 921d5fd90e..cae1ac9253 100644 --- a/vendor/google.golang.org/api/compute/v1/compute-api.json +++ b/vendor/google.golang.org/api/compute/v1/compute-api.json @@ -1,11 +1,11 @@ { "kind": "discovery#restDescription", - "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/zfEgIM85dgKQ1dAjVHrRpCmO0gk\"", + "etag": "\"ye6orv2F-1npMW3u9suM3a7C5Bo/hSx28Nr9JtRTbPKprjxvGcypH5Y\"", "discoveryVersion": "v1", "id": "compute:v1", "name": "compute", "version": "v1", - "revision": "20150617", + "revision": "20151111", "title": "Compute Engine API", "description": "API for the Google Compute Engine service.", "ownerDomain": "google.com", @@ -165,7 +165,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "status": { "type": "string", @@ -215,7 +215,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -246,7 +246,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." } } }, @@ -341,7 +341,7 @@ }, "deviceName": { "type": "string", - "description": "Specifies a unique device name of your choice that is reflected into the /dev/ tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.\n\nIf not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks." + "description": "Specifies a unique device name of your choice that is reflected into the /dev/disk/by-id/google-* tree of a Linux operating system running within the instance. This name can be used to reference the device for mounting, resizing, and so on, from within the instance.\n\nIf not specified, the server chooses a default device name to apply to this disk, in the form persistent-disks-x, where x is a number assigned by Google Compute Engine. This field is only applicable for persistent disks." }, "index": { "type": "integer", @@ -354,6 +354,7 @@ }, "interface": { "type": "string", + "description": "Specifies the disk interface to use for attaching this disk, either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.", "enum": [ "NVME", "SCSI" @@ -434,6 +435,285 @@ } } }, + "Autoscaler": { + "id": "Autoscaler", + "type": "object", + "properties": { + "autoscalingPolicy": { + "$ref": "AutoscalingPolicy", + "description": "Autoscaling configuration." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#autoscaler" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "annotations": { + "required": [ + "compute.instanceGroups.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "target": { + "type": "string", + "description": "URL of Instance Group Manager or Replica Pool which will be controlled by Autoscaler." + }, + "zone": { + "type": "string", + "description": "[Output Only] URL of the zone where the instance group resides." + } + } + }, + "AutoscalerAggregatedList": { + "id": "AutoscalerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "object", + "description": "A map of scoped autoscaler lists.", + "additionalProperties": { + "$ref": "AutoscalersScopedList", + "description": "Name of the scope containing this set of autoscalers." + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AutoscalerList": { + "id": "AutoscalerList", + "type": "object", + "description": "Contains a list of persistent autoscaler resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of Autoscaler resources.", + "items": { + "$ref": "Autoscaler" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#autoscalerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "AutoscalersScopedList": { + "id": "AutoscalersScopedList", + "type": "object", + "properties": { + "autoscalers": { + "type": "array", + "description": "List of autoscalers contained in this scope.", + "items": { + "$ref": "Autoscaler" + } + }, + "warning": { + "type": "object", + "description": "Informational warning which replaces the list of autoscalers when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "AutoscalingPolicy": { + "id": "AutoscalingPolicy", + "type": "object", + "description": "Cloud Autoscaler policy.", + "properties": { + "coolDownPeriodSec": { + "type": "integer", + "description": "The number of seconds that the Autoscaler should wait between two succeeding changes to the number of virtual machines. You should define an interval that is at least as long as the initialization time of a virtual machine and the time it may take for replica pool to create the virtual machine. The default is 60 seconds.", + "format": "int32" + }, + "cpuUtilization": { + "$ref": "AutoscalingPolicyCpuUtilization", + "description": "TODO(jbartosik): Add support for scaling based on muliple utilization metrics (take max recommendation). Exactly one utilization policy should be provided. Configuration parameters of CPU based autoscaling policy." + }, + "customMetricUtilizations": { + "type": "array", + "description": "Configuration parameters of autoscaling based on custom metric.", + "items": { + "$ref": "AutoscalingPolicyCustomMetricUtilization" + } + }, + "loadBalancingUtilization": { + "$ref": "AutoscalingPolicyLoadBalancingUtilization", + "description": "Configuration parameters of autoscaling based on load balancer." + }, + "maxNumReplicas": { + "type": "integer", + "description": "The maximum number of replicas that the Autoscaler can scale up to. This field is required for config to be effective. Maximum number of replicas should be not lower than minimal number of replicas. Absolute limit for this value is defined in Autoscaler backend.", + "format": "int32" + }, + "minNumReplicas": { + "type": "integer", + "description": "The minimum number of replicas that the Autoscaler can scale down to. Can't be less than 0. If not provided Autoscaler will choose default value depending on maximal number of replicas.", + "format": "int32" + } + } + }, + "AutoscalingPolicyCpuUtilization": { + "id": "AutoscalingPolicyCpuUtilization", + "type": "object", + "description": "CPU utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "The target utilization that the Autoscaler should maintain. It is represented as a fraction of used cores. For example: 6 cores used in 8-core VM are represented here as 0.75. Must be a float value between (0, 1]. If not defined, the default is 0.8.", + "format": "double" + } + } + }, + "AutoscalingPolicyCustomMetricUtilization": { + "id": "AutoscalingPolicyCustomMetricUtilization", + "type": "object", + "description": "Custom utilization metric policy.", + "properties": { + "metric": { + "type": "string", + "description": "Identifier of the metric. It should be a Cloud Monitoring metric. The metric can not have negative values. The metric should be an utilization metric (increasing number of VMs handling requests x times should reduce average value of the metric roughly x times). For example you could use: compute.googleapis.com/instance/network/received_bytes_count." + }, + "utilizationTarget": { + "type": "number", + "description": "Target value of the metric which Autoscaler should maintain. Must be a positive value.", + "format": "double" + }, + "utilizationTargetType": { + "type": "string", + "description": "Defines type in which utilization_target is expressed.", + "enum": [ + "DELTA_PER_MINUTE", + "DELTA_PER_SECOND", + "GAUGE" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "AutoscalingPolicyLoadBalancingUtilization": { + "id": "AutoscalingPolicyLoadBalancingUtilization", + "type": "object", + "description": "Load balancing utilization policy.", + "properties": { + "utilizationTarget": { + "type": "number", + "description": "Fraction of backend capacity utilization (set in HTTP load balancing configuration) that Autoscaler should maintain. Must be a positive float value. If not defined, the default is 0.8. For example if your maxRatePerInstance capacity (in HTTP Load Balancing configuration) is set at 10 and you would like to keep number of instances such that each instance receives 7 QPS on average, set this to 0.7.", + "format": "double" + } + } + }, "Backend": { "id": "Backend", "type": "object", @@ -441,7 +721,7 @@ "properties": { "balancingMode": { "type": "string", - "description": "The balancing mode of this backend, default is UTILIZATION.", + "description": "Specifies the balancing mode for this backend. The default is UTILIZATION but available values are UTILIZATION and RATE.", "enum": [ "RATE", "UTILIZATION" @@ -453,16 +733,16 @@ }, "capacityScaler": { "type": "number", - "description": "The multiplier (a value between 0.0 and 1.0) of the max capacity (CPU or RPS, depending on 'balancingMode') the group should serve up to. 0 means the group is totally drained. Default value is 1. Valid range is [0.0, 1.0].", + "description": "A multiplier applied to the group's maximum servicing capacity (either UTILIZATION or RATE). Default value is 1, which means the group will serve up to 100% of its configured CPU or RPS (depending on balancingMode). A setting of 0 means the group is completely drained, offering 0% of its available CPU or RPS. Valid range is [0.0,1.0].", "format": "float" }, "description": { "type": "string", - "description": "An optional textual description of the resource, which is provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "group": { "type": "string", - "description": "URL of a zonal Cloud Resource View resource. This resource view defines the list of instances that serve traffic. Member virtual machine instances from each resource view must live in the same zone as the resource view itself. No two backends in a backend service are allowed to use same Resource View resource." + "description": "The fully-qualified URL of a zonal Instance Group resource. This instance group defines the list of instances that serve traffic. Member virtual machine instances from each instance group must live in the same zone as the instance group itself. No two backends in a backend service are allowed to use same Instance Group resource.\n\nNote that you must specify an Instance Group resource using the fully-qualified URL, rather than a partial URL." }, "maxRate": { "type": "integer", @@ -476,7 +756,7 @@ }, "maxUtilization": { "type": "number", - "description": "Used when 'balancingMode' is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0, 1].", + "description": "Used when balancingMode is UTILIZATION. This ratio defines the CPU utilization target for the group. The default is 0.8. Valid range is [0.0, 1.0].", "format": "float" } } @@ -484,7 +764,7 @@ "BackendService": { "id": "BackendService", "type": "object", - "description": "A BackendService resource. This resource defines a group of backend VMs together with their serving capacity.\n\nIf you add field foo, you probably need to also add: com.google.cloud.cluster.manager.api.BackendServiceResource: foo com.google.cloud.cluster.manager.networking.entities: BackendService, BackendServiceEntity: getFoo, setFoo:\n\nConverters/mappers will need to be updated: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverter: toResource, updateEntity: copy foo com.google.cloud.cluster.mixer.protomappers.BackendServiceMappers.ResourceMapper: ResourceMapper: add a new map call\n\nTests to update: com.google.cloud.cluster.manager.networking.services.backendservice.BackendServiceResourceConverterTest com.google.cloud.cluster.mixer.protomappers.BackendServiceMappersTest.testResourceMapping", + "description": "A BackendService resource. This resource defines a group of backend virtual machines together with their serving capacity.", "properties": { "backends": { "type": "array", @@ -495,11 +775,11 @@ }, "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "fingerprint": { "type": "string", @@ -508,29 +788,29 @@ }, "healthChecks": { "type": "array", - "description": "The list of URLs to the HttpHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required.", + "description": "The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for health checking this BackendService. Currently at most one health check can be specified, and a health check is required.", "items": { "type": "string" } }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of resource. Always compute#backendService for backend services.", "default": "compute#backendService" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "port": { "type": "integer", - "description": "Deprecated in favor of port_name. The TCP port to connect on the backend. The default value is 80.", + "description": "Deprecated in favor of port name. The TCP port to connect on the backend. The default value is 80.", "format": "int32" }, "portName": { @@ -540,15 +820,17 @@ "protocol": { "type": "string", "enum": [ - "HTTP" + "HTTP", + "HTTPS" ], "enumDescriptions": [ + "", "" ] }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "timeoutSec": { "type": "integer", @@ -569,7 +851,7 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "[Output Only] Type of resource. Always compute#backendServiceGroupHealth for the health of backend services.", "default": "compute#backendServiceGroupHealth" } } @@ -581,7 +863,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -592,16 +874,16 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "[Output Only] Type of resource. Always compute#backendServiceList for lists of backend services.", "default": "compute#backendServiceList" }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -779,7 +1061,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -810,7 +1092,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -839,7 +1121,7 @@ }, "defaultDiskSizeGb": { "type": "string", - "description": "[Output Only] Server defined default disk size in GB.", + "description": "[Output Only] Server-defined default disk size in GB.", "format": "int64" }, "deprecated": { @@ -867,7 +1149,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "validDiskSize": { "type": "string", @@ -906,7 +1188,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -937,7 +1219,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -1120,7 +1402,7 @@ }, "creationTimestamp": { "type": "string", - "description": "[Output Only] Creation timestamp in RFC3339text format." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -1153,25 +1435,25 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "sourceRanges": { "type": "array", - "description": "The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range or the tag of the source matches the sourceRanges OR matches the sourceTags property; the connection does not need to match both properties.", + "description": "The IP address blocks that this rule applies to, expressed in CIDR format. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", "items": { "type": "string" } }, "sourceTags": { "type": "array", - "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range or the tag of the source matches the sourceRanges OR matches the sourceTags property; the connection does not need to match both properties.", + "description": "A list of instance tags which this rule applies to. One or both of sourceRanges and sourceTags may be set.\n\nIf both properties are set, an inbound connection is allowed if the range matches the sourceRanges OR the tag of the source matches the sourceTags property. The connection does not need to match both properties.", "items": { "type": "string" } }, "targetTags": { "type": "array", - "description": "A list of instance tags indicating sets of instances located on network which may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", + "description": "A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network.", "items": { "type": "string" } @@ -1205,14 +1487,14 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, "ForwardingRule": { "id": "ForwardingRule", "type": "object", - "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target VMs to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple.", + "description": "A ForwardingRule resource. A ForwardingRule resource specifies which pool of target virtual machines to forward a packet to if it matches the given [IPAddress, IPProtocol, portRange] tuple.", "properties": { "IPAddress": { "type": "string", @@ -1220,7 +1502,7 @@ }, "IPProtocol": { "type": "string", - "description": "The IP protocol to which this rule applies, valid options are 'TCP', 'UDP', 'ESP', 'AH' or 'SCTP'.", + "description": "The IP protocol to which this rule applies. Valid options are TCP, UDP, ESP, AH or SCTP.", "enum": [ "AH", "ESP", @@ -1238,7 +1520,7 @@ }, "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -1246,34 +1528,34 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of the resource. Always compute#forwardingRule.", "default": "compute#forwardingRule" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "portRange": { "type": "string", - "description": "Applicable only when 'IPProtocol' is 'TCP', 'UDP' or 'SCTP', only packets addressed to ports in the specified range will be forwarded to 'target'. If 'portRange' is left empty (default value), all ports are forwarded. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges." + "description": "Applicable only when IPProtocol is TCP, UDP, or SCTP, only packets addressed to ports in the specified range will be forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] pair must have disjoint port ranges." }, "region": { "type": "string", - "description": "URL of the region where the regional forwarding rule resides (output only). This field is not applicable to global forwarding rules." + "description": "[Output Only] URL of the region where the regional forwarding rule resides. This field is not applicable to global forwarding rules." }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "target": { "type": "string", - "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy resource." + "description": "The URL of the target resource to receive the matched traffic. For regional forwarding rules, this target must live in the same region as the forwarding rule. For global forwarding rules, this target must be a global TargetHttpProxy or TargetHttpsProxy resource." } } }, @@ -1283,7 +1565,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", @@ -1300,11 +1582,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -1315,7 +1597,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Set by the server." }, "items": { "type": "array", @@ -1331,11 +1613,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -1458,28 +1740,29 @@ "HostRule": { "id": "HostRule", "type": "object", - "description": "A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", + "description": "UrlMaps A host-matching rule for a URL. If matched, will use the named PathMatcher to select the BackendService.", "properties": { "description": { - "type": "string" + "type": "string", + "description": "An optional textual description." }, "hosts": { "type": "array", - "description": "The list of host patterns to match. They must be valid hostnames except that they may start with *. or *-. The * acts like a glob and will match any string of atoms (separated by .s and -s) to the left.", + "description": "The list of host patterns to match. They must be valid hostnames, except * will match any string of ([a-z0-9-.]*). In that case, * must be the first character and must be followed in the pattern by either - or ..", "items": { "type": "string" } }, "pathMatcher": { "type": "string", - "description": "The name of the PathMatcher to match the path portion of the URL, if the this HostRule matches the URL's host portion." + "description": "The name of the PathMatcher to use to match the path portion of the URL if the hostRule matches the URL's host portion." } } }, "HttpHealthCheck": { "id": "HttpHealthCheck", "type": "object", - "description": "An HttpHealthCheck resource. This resource defines a template for how individual VMs should be checked for health, via HTTP.", + "description": "An HttpHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTP.", "properties": { "checkIntervalSec": { "type": "integer", @@ -1488,7 +1771,7 @@ }, "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -1496,7 +1779,7 @@ }, "healthyThreshold": { "type": "integer", - "description": "A so-far unhealthy VM will be marked healthy after this many consecutive successes. The default value is 2.", + "description": "A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.", "format": "int32" }, "host": { @@ -1505,7 +1788,7 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { @@ -1515,7 +1798,7 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "port": { @@ -1529,7 +1812,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "timeoutSec": { "type": "integer", @@ -1538,7 +1821,7 @@ }, "unhealthyThreshold": { "type": "integer", - "description": "A so-far healthy VM will be marked unhealthy after this many consecutive failures. The default value is 2.", + "description": "A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.", "format": "int32" } } @@ -1550,7 +1833,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -1566,11 +1849,109 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "HttpsHealthCheck": { + "id": "HttpsHealthCheck", + "type": "object", + "description": "An HttpsHealthCheck resource. This resource defines a template for how individual instances should be checked for health, via HTTPS.", + "properties": { + "checkIntervalSec": { + "type": "integer", + "description": "How often (in seconds) to send a health check. The default value is 5 seconds.", + "format": "int32" + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource; provided by the client when the resource is created." + }, + "healthyThreshold": { + "type": "integer", + "description": "A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2.", + "format": "int32" + }, + "host": { + "type": "string", + "description": "The value of the host header in the HTTPS health check request. If left empty (default value), the public IP on behalf of which this health check is performed will be used." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#httpsHealthCheck" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "port": { + "type": "integer", + "description": "The TCP port number for the HTTPS health check request. The default value is 443.", + "format": "int32" + }, + "requestPath": { + "type": "string", + "description": "The request path of the HTTPS health check request. The default value is \"/\"." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "timeoutSec": { + "type": "integer", + "description": "How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have a greater value than checkIntervalSec.", + "format": "int32" + }, + "unhealthyThreshold": { + "type": "integer", + "description": "A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2.", + "format": "int32" + } + } + }, + "HttpsHealthCheckList": { + "id": "HttpsHealthCheckList", + "type": "object", + "description": "Contains a list of HttpsHealthCheck resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of HttpsHealthCheck resources.", + "items": { + "$ref": "HttpsHealthCheck" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#httpsHealthCheckList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -1660,7 +2041,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "sourceDisk": { "type": "string", @@ -1704,11 +2085,11 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", - "description": "A list of Image resources.", + "description": "[Output Only] A list of Image resources.", "items": { "$ref": "Image" } @@ -1720,11 +2101,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -1874,6 +2255,650 @@ } } }, + "InstanceGroup": { + "id": "InstanceGroup", + "type": "object", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this instance group in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional text description for the instance group." + }, + "fingerprint": { + "type": "string", + "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" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroup for instance groups.", + "default": "compute#instanceGroup" + }, + "name": { + "type": "string", + "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])?", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "namedPorts": { + "type": "array", + "description": "Assigns a name to a port number. For example: {name: \"http\", port: 80}\n\nThis 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: \"http\", port: 80},{name: \"http\", port: 8080}] \n\nNamed ports apply to all instances in this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "network": { + "type": "string", + "description": "[Output Only] The URL of the network to which all instances in the instance group belong." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this instance group. The server generates this URL." + }, + "size": { + "type": "integer", + "description": "[Output Only] The total number of instances in the instance group.", + "format": "int32" + }, + "zone": { + "type": "string", + "description": "[Output Only] The URL of the zone where the instance group is located." + } + } + }, + "InstanceGroupAggregatedList": { + "id": "InstanceGroupAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of instance groups. The server generates this identifier." + }, + "items": { + "type": "object", + "description": "A map of scoped instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupsScopedList", + "description": "The name of the scope that contains this set of instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupAggregatedList for aggregated lists of instance groups.", + "default": "compute#instanceGroupAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupList": { + "id": "InstanceGroupList", + "type": "object", + "description": "A list of InstanceGroup resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "A list of instance groups.", + "items": { + "$ref": "InstanceGroup" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupList for instance group lists.", + "default": "compute#instanceGroupList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManager": { + "id": "InstanceGroupManager", + "type": "object", + "description": "InstanceGroupManagers\n\nNext available tag: 20", + "properties": { + "baseInstanceName": { + "type": "string", + "description": "The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by appending a hyphen and a random four-character string to the base instance name. The base instance name must comply with RFC1035.", + "pattern": "[a-z][-a-z0-9]{0,57}", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] The creation timestamp for this managed instance group in RFC3339 text format." + }, + "currentActions": { + "$ref": "InstanceGroupManagerActionsSummary", + "description": "[Output Only] The list of instance actions and the number of instances in this managed instance group that are scheduled for each of those actions." + }, + "description": { + "type": "string", + "description": "An optional text description for the managed instance group." + }, + "fingerprint": { + "type": "string", + "description": "[Output Only] The fingerprint of the target pools information. You can use this optional field for optimistic locking when you update the target pool entries.", + "format": "byte" + }, + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier.", + "format": "uint64" + }, + "instanceGroup": { + "type": "string", + "description": "[Output Only] The URL of the Instance Group resource." + }, + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group.", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManager for managed instance groups.", + "default": "compute#instanceGroupManager" + }, + "name": { + "type": "string", + "description": "The name of the managed 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])?", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this managed instance group. The server defines this URL." + }, + "targetPools": { + "type": "array", + "description": "The URLs for all TargetPool resources to which instances in the instanceGroup field are added. The target pools automatically apply to all of the instances in the managed instance group.", + "items": { + "type": "string" + } + }, + "targetSize": { + "type": "integer", + "description": "The target number of running instances for this managed instance group. Deleting or abandoning instances reduces this number. Resizing the group changes this number.", + "format": "int32", + "annotations": { + "required": [ + "compute.instanceGroupManagers.insert" + ] + } + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located." + } + } + }, + "InstanceGroupManagerActionsSummary": { + "id": "InstanceGroupManagerActionsSummary", + "type": "object", + "properties": { + "abandoning": { + "type": "integer", + "description": "[Output Only] The total number of instances in the managed instance group that are scheduled to be abandoned. Abandoning an instance removes it from the managed instance group without deleting it.", + "format": "int32" + }, + "creating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be created or are currently being created.", + "format": "int32" + }, + "deleting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be deleted or are currently being deleted.", + "format": "int32" + }, + "none": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are running and have no scheduled actions.", + "format": "int32" + }, + "recreating": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be recreated or are currently being being recreated. Recreating an instance deletes the existing root persistent disk and creates a new disk from the image that is defined in the instance template.", + "format": "int32" + }, + "refreshing": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are being reconfigured with properties that do not require a restart or a recreate action. For example, setting or removing target pools for the instance.", + "format": "int32" + }, + "restarting": { + "type": "integer", + "description": "[Output Only] The number of instances in the managed instance group that are scheduled to be restarted or are currently being restarted.", + "format": "int32" + } + } + }, + "InstanceGroupManagerAggregatedList": { + "id": "InstanceGroupManagerAggregatedList", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this aggregated list of managed instance groups. The server generates this identifier." + }, + "items": { + "type": "object", + "description": "[Output Only] A map of filtered managed instance group lists.", + "additionalProperties": { + "$ref": "InstanceGroupManagersScopedList", + "description": "[Output Only] The name of the scope that contains this set of managed instance groups." + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerAggregatedList for an aggregated list of managed instance groups.", + "default": "compute#instanceGroupManagerAggregatedList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManagerList": { + "id": "InstanceGroupManagerList", + "type": "object", + "description": "[Output Only] A list of managed instance groups.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this resource type. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of managed instance groups.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupManagerList for a list of managed instance groups.", + "default": "compute#instanceGroupManagerList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this resource type. The server generates this URL." + } + } + }, + "InstanceGroupManagersAbandonInstancesRequest": { + "id": "InstanceGroupManagersAbandonInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The URL for one or more instances to abandon from the managed instance group.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersDeleteInstancesRequest": { + "id": "InstanceGroupManagersDeleteInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to delete from this managed instance group. Specify one or more instance URLs.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersListManagedInstancesResponse": { + "id": "InstanceGroupManagersListManagedInstancesResponse", + "type": "object", + "properties": { + "managedInstances": { + "type": "array", + "description": "[Output Only] The list of instances in the managed instance group.", + "items": { + "$ref": "ManagedInstance" + } + } + } + }, + "InstanceGroupManagersRecreateInstancesRequest": { + "id": "InstanceGroupManagersRecreateInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The URL for one or more instances to recreate.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupManagersScopedList": { + "id": "InstanceGroupManagersScopedList", + "type": "object", + "properties": { + "instanceGroupManagers": { + "type": "array", + "description": "[Output Only] The list of managed instance groups that are contained in the specified project and zone.", + "items": { + "$ref": "InstanceGroupManager" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] The warning that replaces the list of managed instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupManagersSetInstanceTemplateRequest": { + "id": "InstanceGroupManagersSetInstanceTemplateRequest", + "type": "object", + "properties": { + "instanceTemplate": { + "type": "string", + "description": "The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group." + } + } + }, + "InstanceGroupManagersSetTargetPoolsRequest": { + "id": "InstanceGroupManagersSetTargetPoolsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the target pools information. Use this optional property to prevent conflicts when multiple users change the target pools settings concurrently. Obtain the fingerprint with the instanceGroupManagers.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.", + "format": "byte" + }, + "targetPools": { + "type": "array", + "description": "The list of target pool URLs that instances in this managed instance group belong to. The managed instance group applies these target pools to all of the instances in the group. Existing instances and new instances in the group all receive these target pool settings.", + "items": { + "type": "string" + } + } + } + }, + "InstanceGroupsAddInstancesRequest": { + "id": "InstanceGroupsAddInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to add to the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsListInstances": { + "id": "InstanceGroupsListInstances", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] A unique identifier for this list of instance groups. The server generates this identifier." + }, + "items": { + "type": "array", + "description": "[Output Only] A list of instances and any named ports that are assigned to those instances.", + "items": { + "$ref": "InstanceWithNamedPorts" + } + }, + "kind": { + "type": "string", + "description": "[Output Only] The resource type, which is always compute#instanceGroupsListInstances for lists of instance groups.", + "default": "compute#instanceGroupsListInstances" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token that is used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] The URL for this list of instance groups. The server generates this URL." + } + } + }, + "InstanceGroupsListInstancesRequest": { + "id": "InstanceGroupsListInstancesRequest", + "type": "object", + "properties": { + "instanceState": { + "type": "string", + "description": "A filter for the state of the instances in the instance group. Valid options are ALL or RUNNING. If you do not specify this parameter the list includes all instances regardless of their state.", + "enum": [ + "ALL", + "RUNNING" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "InstanceGroupsRemoveInstancesRequest": { + "id": "InstanceGroupsRemoveInstancesRequest", + "type": "object", + "properties": { + "instances": { + "type": "array", + "description": "The list of instances to remove from the instance group.", + "items": { + "$ref": "InstanceReference" + } + } + } + }, + "InstanceGroupsScopedList": { + "id": "InstanceGroupsScopedList", + "type": "object", + "properties": { + "instanceGroups": { + "type": "array", + "description": "[Output Only] The list of instance groups that are contained in this scope.", + "items": { + "$ref": "InstanceGroup" + } + }, + "warning": { + "type": "object", + "description": "[Output Only] An informational warning that replaces the list of instance groups when the list is empty.", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The warning type identifier for this warning.", + "enum": [ + "DEPRECATED_RESOURCE_USED", + "DISK_SIZE_LARGER_THAN_IMAGE_SIZE", + "INJECTED_KERNELS_DEPRECATED", + "NEXT_HOP_ADDRESS_NOT_ASSIGNED", + "NEXT_HOP_CANNOT_IP_FORWARD", + "NEXT_HOP_INSTANCE_NOT_FOUND", + "NEXT_HOP_INSTANCE_NOT_ON_NETWORK", + "NEXT_HOP_NOT_RUNNING", + "NOT_CRITICAL_ERROR", + "NO_RESULTS_ON_PAGE", + "REQUIRED_TOS_AGREEMENT", + "RESOURCE_NOT_DELETED", + "SINGLE_INSTANCE_PROPERTY_TEMPLATE", + "UNREACHABLE" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "data": { + "type": "array", + "description": "[Output Only] Metadata for this warning in key: value format.", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "[Output Only] A key for the warning data." + }, + "value": { + "type": "string", + "description": "[Output Only] A warning data value corresponding to the key." + } + } + } + }, + "message": { + "type": "string", + "description": "[Output Only] Optional human-readable details for this warning." + } + } + } + } + }, + "InstanceGroupsSetNamedPortsRequest": { + "id": "InstanceGroupsSetNamedPortsRequest", + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "The fingerprint of the named ports information for this instance group. Use this optional property to prevent conflicts when multiple users change the named ports settings concurrently. Obtain the fingerprint with the instanceGroups.get method. Then, include the fingerprint in your request to ensure that you do not overwrite changes that were applied from another concurrent request.", + "format": "byte" + }, + "namedPorts": { + "type": "array", + "description": "The list of named ports to set for this instance group.", + "items": { + "$ref": "NamedPort" + } + } + } + }, "InstanceList": { "id": "InstanceList", "type": "object", @@ -1926,7 +2951,7 @@ "properties": { "canIpForward": { "type": "boolean", - "description": "A boolean that specifies if instances created from this template can send packets with source IP addresses other than their own or receive packets with destination IP addresses other than their own. If you use these instances as an IP gateway or as the next-hop in a Route resource, specify true. Otherwise, specify false." + "description": "Enables instances created based on this template to send packets with source IP addresses other than their own and receive packets with destination IP addresses other than their own. If these instances will be used as an IP gateway or it will be set as the next-hop in a Route resource, specify true. If unsure, leave this set to false. See the canIpForward documentation for more information." }, "description": { "type": "string", @@ -1954,14 +2979,14 @@ }, "networkInterfaces": { "type": "array", - "description": "An array of network access configurations for this interface. This specifies how this interface is configured to interact with other network services, such as connecting to the internet. Currently, ONE_TO_ONE_NAT is the only supported access configuration. If you do not specify any access configurations, the instances that are created from this template will have no external internet access.", + "description": "An array of network access configurations for this interface.", "items": { "$ref": "NetworkInterface" } }, "scheduling": { "$ref": "Scheduling", - "description": "A list of scheduling options for the instances that are created from this template." + "description": "Specifies the scheduling options for the instances that are created from this template." }, "serviceAccounts": { "type": "array", @@ -1981,7 +3006,8 @@ "type": "object", "properties": { "instance": { - "type": "string" + "type": "string", + "description": "The URL for a specific instance." } } }, @@ -2010,7 +3036,7 @@ }, "name": { "type": "string", - "description": "The name of the instance template. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -2020,7 +3046,7 @@ }, "properties": { "$ref": "InstanceProperties", - "description": "The instance properties for the instance template resource." + "description": "The instance properties for this instance template." }, "selfLink": { "type": "string", @@ -2039,7 +3065,7 @@ }, "items": { "type": "array", - "description": "A list of InstanceTemplate resources.", + "description": "[Output Only] list of InstanceTemplate resources.", "items": { "$ref": "InstanceTemplate" } @@ -2059,6 +3085,47 @@ } } }, + "InstanceWithNamedPorts": { + "id": "InstanceWithNamedPorts", + "type": "object", + "properties": { + "instance": { + "type": "string", + "description": "[Output Only] The URL of the instance." + }, + "namedPorts": { + "type": "array", + "description": "[Output Only] The named ports that belong to this instance group.", + "items": { + "$ref": "NamedPort" + } + }, + "status": { + "type": "string", + "description": "[Output Only] The status of the instance.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, "InstancesScopedList": { "id": "InstancesScopedList", "type": "object", @@ -2151,7 +3218,7 @@ }, "name": { "type": "string", - "description": "Name of the resource. The name must be 1-63 characters long, and comply with RCF1035.", + "description": "[Output Only] Name of the resource. The name is 1-63 characters long and complies with RFC1035.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -2161,7 +3228,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." } } }, @@ -2238,7 +3305,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "zone": { "type": "string", @@ -2273,7 +3340,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -2304,7 +3371,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -2384,6 +3451,104 @@ } } }, + "ManagedInstance": { + "id": "ManagedInstance", + "type": "object", + "properties": { + "currentAction": { + "type": "string", + "description": "[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: \n- NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. \n- CREATING The managed instance group is creating this instance. \n- RECREATING The managed instance group is recreating this instance. \n- DELETING The managed instance group is permanently deleting this instance. \n- ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. \n- RESTARTING The managed instance group is restarting the instance. \n- REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.", + "enum": [ + "ABANDONING", + "CREATING", + "DELETING", + "NONE", + "RECREATING", + "REFRESHING", + "RESTARTING" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "id": { + "type": "string", + "description": "[Output only] The unique identifier for this resource. This field is empty when instance does not exist.", + "format": "uint64" + }, + "instance": { + "type": "string", + "description": "[Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created." + }, + "instanceStatus": { + "type": "string", + "description": "[Output Only] The status of the instance. This field is empty when the instance does not exist.", + "enum": [ + "PROVISIONING", + "RUNNING", + "STAGING", + "STOPPED", + "STOPPING", + "SUSPENDED", + "SUSPENDING", + "TERMINATED" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "lastAttempt": { + "$ref": "ManagedInstanceLastAttempt", + "description": "[Output Only] Information about the last attempt to create or delete the instance." + } + } + }, + "ManagedInstanceLastAttempt": { + "id": "ManagedInstanceLastAttempt", + "type": "object", + "properties": { + "errors": { + "type": "object", + "description": "[Output Only] Encountered errors during the last attempt to create or delete the instance.", + "properties": { + "errors": { + "type": "array", + "description": "[Output Only] The array of errors encountered while processing this operation.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "[Output Only] The error type identifier for this error." + }, + "location": { + "type": "string", + "description": "[Output Only] Indicates the field in the request which caused the error. This property is optional." + }, + "message": { + "type": "string", + "description": "[Output Only] An optional, human-readable error message." + } + } + } + } + } + } + } + }, "Metadata": { "id": "Metadata", "type": "object", @@ -2431,6 +3596,22 @@ } } }, + "NamedPort": { + "id": "NamedPort", + "type": "object", + "description": "The named port. For example: .", + "properties": { + "name": { + "type": "string", + "description": "The name for this named port. The name must be 1-63 characters long, and comply with RFC1035." + }, + "port": { + "type": "integer", + "description": "The port number, which can be a value between 1 and 65535.", + "format": "int32" + } + } + }, "Network": { "id": "Network", "type": "object", @@ -2439,12 +3620,7 @@ "IPv4Range": { "type": "string", "description": "The range of internal addresses that are legal on this network. This range is a CIDR specification, for example: 192.168.0.0/16. Provided by the client when the network is created.", - "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}", - "annotations": { - "required": [ - "compute.networks.insert" - ] - } + "pattern": "[0-9]{1,3}(?:\\.[0-9]{1,3}){3}/[0-9]{1,2}" }, "creationTimestamp": { "type": "string", @@ -2452,7 +3628,7 @@ }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "gatewayIPv4": { "type": "string", @@ -2461,7 +3637,7 @@ }, "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { @@ -2471,7 +3647,7 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -2481,7 +3657,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." } } }, @@ -2492,7 +3668,7 @@ "properties": { "accessConfigs": { "type": "array", - "description": "An array of configurations for this interface. Currently, \u003ccodeONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", + "description": "An array of configurations for this interface. Currently, ONE_TO_ONE_NAT is the only access config supported. If there are no accessConfigs specified, then this instance will have no external internet access.", "items": { "$ref": "AccessConfig" } @@ -2523,7 +3699,7 @@ "properties": { "id": { "type": "string", - "description": "[Output Only] Unique identifier for the resource; defined by the server." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -2543,18 +3719,18 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource ." + "description": "[Output Only] Server-defined URL for this resource ." } } }, "Operation": { "id": "Operation", "type": "object", - "description": "An operation resource, used to manage asynchronous API requests.", + "description": "An Operation resource, used to manage asynchronous API requests.", "properties": { "clientOperationId": { "type": "string", - "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project." + "description": "[Output Only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all Operation resources in the project." }, "creationTimestamp": { "type": "string", @@ -2611,7 +3787,7 @@ }, "kind": { "type": "string", - "description": "[Output Only] Type of the resource. Always compute#Operation for Operation resources.", + "description": "[Output Only] Type of the resource. Always compute#operation for Operation resources.", "default": "compute#operation" }, "name": { @@ -2620,7 +3796,7 @@ }, "operationType": { "type": "string", - "description": "[Output Only] Type of the operation, such as insert, update, and delete." + "description": "[Output Only] Type of the operation, such as insert, compute.instanceGroups.update, or compute.instanceGroups.delete." }, "progress": { "type": "integer", @@ -2633,7 +3809,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "startTime": { "type": "string", @@ -2769,14 +3945,14 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, "OperationList": { "id": "OperationList", "type": "object", - "description": "Contains a list of operation resources.", + "description": "Contains a list of Operation resources.", "properties": { "id": { "type": "string", @@ -2784,7 +3960,7 @@ }, "items": { "type": "array", - "description": "[Output Only] The operation resources.", + "description": "[Output Only] The Operation resources.", "items": { "$ref": "Operation" } @@ -2800,7 +3976,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -2883,14 +4059,14 @@ "PathMatcher": { "id": "PathMatcher", "type": "object", - "description": "A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default_service will be used.", + "description": "A matcher for the path portion of the URL. The BackendService from the longest-matched rule will serve the URL. If no rule was matched, the default service will be used.", "properties": { "defaultService": { - "type": "string", - "description": "The URL to the BackendService resource. This will be used if none of the 'pathRules' defined by this PathMatcher is met by the URL's path portion." + "type": "string" }, "description": { - "type": "string" + "type": "string", + "description": "An optional textual description of the resource." }, "name": { "type": "string", @@ -2940,6 +4116,13 @@ "type": "string", "description": "An optional textual description of the resource." }, + "enabledFeatures": { + "type": "array", + "description": "Restricted features enabled for use on this project.", + "items": { + "type": "string" + } + }, "id": { "type": "string", "description": "[Output Only] Unique identifier for the resource; defined by the server.", @@ -2963,7 +4146,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "usageExportLocation": { "$ref": "UsageExportLocation", @@ -2993,6 +4176,8 @@ "HEALTH_CHECKS", "IMAGES", "INSTANCES", + "INSTANCE_GROUPS", + "INSTANCE_GROUP_MANAGERS", "INSTANCE_TEMPLATES", "IN_USE_ADDRESSES", "LOCAL_SSD_TOTAL_GB", @@ -3000,7 +4185,9 @@ "ROUTES", "SNAPSHOTS", "SSD_TOTAL_GB", + "SSL_CERTIFICATES", "STATIC_ADDRESSES", + "TARGET_HTTPS_PROXIES", "TARGET_HTTP_PROXIES", "TARGET_INSTANCES", "TARGET_POOLS", @@ -3030,6 +4217,10 @@ "", "", "", + "", + "", + "", + "", "" ] }, @@ -3080,7 +4271,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "status": { "type": "string", @@ -3130,7 +4321,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3147,19 +4338,19 @@ "Route": { "id": "Route", "type": "object", - "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with VMs by tag and the set of Routes for a particular VM is called its routing table. For each packet leaving a VM, the system searches that VM's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the next_hop field of the winning Route -- either to another VM destination, a VM gateway or a GCE operated gateway. Packets that do not match any Route in the sending VM's routing table will be dropped.", + "description": "The route resource. A Route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with instances by tag and the set of Routes for a particular instance is called its routing table. For each packet leaving a instance, the system searches that instance's routing table for a single best matching Route. Routes match packets by destination IP address, preferring smaller or more specific ranges over larger ones. If there is a tie, the system selects the Route with the smallest priority value. If there is still a tie, it uses the layer three and four packet headers to select just one of the remaining matching Routes. The packet is then forwarded as specified by the nextHop field of the winning Route -- either to another instance destination, a instance gateway or a Google Compute Engien-operated gateway. Packets that do not match any Route in the sending instance's routing table are dropped.", "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "destRange": { "type": "string", - "description": "Which packets does this route apply to?", + "description": "The destination range of outgoing packets that this route applies to.", "annotations": { "required": [ "compute.routes.insert" @@ -3168,17 +4359,17 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of this resource. Always compute#routes for Route resources.", "default": "compute#route" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -3188,7 +4379,7 @@ }, "network": { "type": "string", - "description": "URL of the network to which this route is applied; provided by the client when the route is created.", + "description": "Fully-qualified URL of the network that this route applies to.", "annotations": { "required": [ "compute.routes.insert" @@ -3197,11 +4388,11 @@ }, "nextHopGateway": { "type": "string", - "description": "The URL to a gateway that should handle matching packets." + "description": "The URL to a gateway that should handle matching packets. Currently, this is only the internet gateway: projects/\u003cproject-id\u003e/global/gateways/default-internet-gateway" }, "nextHopInstance": { "type": "string", - "description": "The URL to an instance that should handle matching packets." + "description": "The fully-qualified URL to an instance that should handle matching packets. For example:\nhttps://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/" }, "nextHopIp": { "type": "string", @@ -3227,7 +4418,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined fully-qualified URL for this resource." }, "tags": { "type": "array", @@ -3243,7 +4434,7 @@ }, "warnings": { "type": "array", - "description": "If potential misconfigurations are detected for this route, this field will be populated with warning messages.", + "description": "[Output Only] If potential misconfigurations are detected for this route, this field will be populated with warning messages.", "items": { "type": "object", "properties": { @@ -3316,7 +4507,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -3332,11 +4523,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3347,11 +4538,11 @@ "properties": { "automaticRestart": { "type": "boolean", - "description": "Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user)." + "description": "Specifies whether the instance should be automatically restarted if it is terminated by Compute Engine (not terminated by a user). You can only set the automatic restart option for standard instances. Preemptible instances cannot be automatically restarted." }, "onHostMaintenance": { "type": "string", - "description": "Defines the maintenance behavior for this instance. The default behavior is MIGRATE. For more information, see Setting maintenance behavior.", + "description": "Defines the maintenance behavior for this instance. For standard instances, the default behavior is MIGRATE. For preemptible instances, the default and only possible behavior is TERMINATE. For more information, see Setting maintenance behavior.", "enum": [ "MIGRATE", "TERMINATE" @@ -3363,7 +4554,7 @@ }, "preemptible": { "type": "boolean", - "description": "Whether the Instance is preemptible." + "description": "Whether the instance is preemptible." } } }, @@ -3412,7 +4603,7 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -3420,17 +4611,17 @@ }, "diskSizeGb": { "type": "string", - "description": "Size of the persistent disk snapshot, specified in GB (output only).", + "description": "[Output Only] Size of the snapshot, specified in GB.", "format": "int64" }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of the resource. Always compute#snapshot for Snapshot resources.", "default": "compute#snapshot" }, "licenses": { @@ -3442,12 +4633,12 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "sourceDisk": { "type": "string", @@ -3455,11 +4646,11 @@ }, "sourceDiskId": { "type": "string", - "description": "The 'id' value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." + "description": "[Output Only] The ID value of the disk used to create this snapshot. This value may be used to determine whether the snapshot was taken from the current or a previous instance of a given disk name." }, "status": { "type": "string", - "description": "The status of the persistent disk snapshot (output only).", + "description": "[Output Only] The status of the snapshot.", "enum": [ "CREATING", "DELETING", @@ -3477,12 +4668,12 @@ }, "storageBytes": { "type": "string", - "description": "A size of the the storage used by the snapshot. As snapshots share storage this number is expected to change with snapshot creation/deletion.", + "description": "[Output Only] A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion.", "format": "int64" }, "storageBytesStatus": { "type": "string", - "description": "An indicator whether storageBytes is in a stable state, or it is being adjusted as a result of shared storage reallocation.", + "description": "[Output Only] An indicator whether storageBytes is in a stable state or it is being adjusted as a result of shared storage reallocation.", "enum": [ "UPDATING", "UP_TO_DATE" @@ -3497,11 +4688,11 @@ "SnapshotList": { "id": "SnapshotList", "type": "object", - "description": "Contains a list of persistent disk snapshot resources.", + "description": "Contains a list of Snapshot resources.", "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -3517,11 +4708,84 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "SslCertificate": { + "id": "SslCertificate", + "type": "object", + "description": "An SslCertificate resource. This resource provides a mechanism to upload an SSL key and certificate to global HTTPS loadbalancer to serve secure connections.", + "properties": { + "certificate": { + "type": "string", + "description": "A local certificate file. The certificate must be in PEM format. The certificate chain must be no greater than 5 certs long. The chain must include at least one intermediate cert." + }, + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "[Output Only] Type of the resource. Always compute#sslCertificate for SSL certificates.", + "default": "compute#sslCertificate" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "privateKey": { + "type": "string", + "description": "A write-only private key in PEM format. Only insert RPCs will include this field." + }, + "selfLink": { + "type": "string", + "description": "[Output only] Server-defined URL for the resource." + } + } + }, + "SslCertificateList": { + "id": "SslCertificateList", + "type": "object", + "description": "Contains a list of SslCertificate resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource. Defined by the server." + }, + "items": { + "type": "array", + "description": "A list of SslCertificate resources.", + "items": { + "$ref": "SslCertificate" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#sslCertificateList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3551,7 +4815,7 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -3559,22 +4823,22 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, "kind": { "type": "string", - "description": "Type of the resource.", + "description": "[Output Only] Type of resource. Always compute#operation for Operation resources.", "default": "compute#targetHttpProxy" }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "urlMap": { "type": "string", @@ -3585,11 +4849,11 @@ "TargetHttpProxyList": { "id": "TargetHttpProxyList", "type": "object", - "description": "Contains a list of TargetHttpProxy resources.", + "description": "A list of TargetHttpProxy resources.", "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3600,27 +4864,116 @@ }, "kind": { "type": "string", - "description": "Type of resource.", + "description": "Type of resource. Always compute#targetHttpProxyList for lists of Target HTTP proxies.", "default": "compute#targetHttpProxyList" }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." + } + } + }, + "TargetHttpsProxiesSetSslCertificatesRequest": { + "id": "TargetHttpsProxiesSetSslCertificatesRequest", + "type": "object", + "properties": { + "sslCertificates": { + "type": "array", + "description": "New set of URLs to SslCertificate resources to associate with this TargetHttpProxy. Currently exactly one ssl certificate must be specified.", + "items": { + "type": "string" + } + } + } + }, + "TargetHttpsProxy": { + "id": "TargetHttpsProxy", + "type": "object", + "description": "A TargetHttpsProxy resource. This resource defines an HTTPS proxy.", + "properties": { + "creationTimestamp": { + "type": "string", + "description": "[Output Only] Creation timestamp in RFC3339 text format." + }, + "description": { + "type": "string", + "description": "An optional textual description of the resource. Provided by the client when the resource is created." + }, + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", + "format": "uint64" + }, + "kind": { + "type": "string", + "description": "Type of the resource.", + "default": "compute#targetHttpsProxy" + }, + "name": { + "type": "string", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for the resource." + }, + "sslCertificates": { + "type": "array", + "description": "URLs to SslCertificate resources that are used to authenticate connections to Backends. Currently exactly one SSL certificate must be specified.", + "items": { + "type": "string" + } + }, + "urlMap": { + "type": "string", + "description": "URL to the UrlMap resource that defines the mapping from URL to the BackendService." + } + } + }, + "TargetHttpsProxyList": { + "id": "TargetHttpsProxyList", + "type": "object", + "description": "Contains a list of TargetHttpsProxy resources.", + "properties": { + "id": { + "type": "string", + "description": "[Output Only] Unique identifier for the resource; defined by the server." + }, + "items": { + "type": "array", + "description": "A list of TargetHttpsProxy resources.", + "items": { + "$ref": "TargetHttpsProxy" + } + }, + "kind": { + "type": "string", + "description": "Type of resource.", + "default": "compute#targetHttpsProxyList" + }, + "nextPageToken": { + "type": "string", + "description": "[Output Only] A token used to continue a truncated list request." + }, + "selfLink": { + "type": "string", + "description": "[Output Only] Server-defined URL for this resource." } } }, "TargetInstance": { "id": "TargetInstance", "type": "object", - "description": "A TargetInstance resource. This resource defines an endpoint VM that terminates traffic of certain protocols.", + "description": "A TargetInstance resource. This resource defines an endpoint instance that terminates traffic of certain protocols.", "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -3628,7 +4981,7 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "instance": { @@ -3642,12 +4995,12 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "natPolicy": { "type": "string", - "description": "NAT option controlling how IPs are NAT'ed to the VM. Currently only NO_NAT (default value) is supported.", + "description": "NAT option controlling how IPs are NAT'ed to the instance. Currently only NO_NAT (default value) is supported.", "enum": [ "NO_NAT" ], @@ -3657,11 +5010,11 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "zone": { "type": "string", - "description": "URL of the zone where the target instance resides (output only)." + "description": "[Output Only] URL of the zone where the target instance resides." } } }, @@ -3671,7 +5024,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "object", @@ -3688,11 +5041,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3703,7 +5056,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource; defined by the server." }, "items": { "type": "array", @@ -3719,11 +5072,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3806,15 +5159,15 @@ "TargetPool": { "id": "TargetPool", "type": "object", - "description": "A TargetPool resource. This resource defines a pool of VMs, associated HttpHealthCheck resources, and the fallback TargetPool.", + "description": "A TargetPool resource. This resource defines a pool of instances, associated HttpHealthCheck resources, and the fallback TargetPool.", "properties": { "backupPool": { "type": "string", - "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its 'failoverRatio' field is properly set to a value between [0, 1].\n\n'backupPool' and 'failoverRatio' together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below 'failoverRatio', traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' and 'backupPool' are not set, or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy." + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1].\n\nbackupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy." }, "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "description": { "type": "string", @@ -3822,24 +5175,24 @@ }, "failoverRatio": { "type": "number", - "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1].\n\nIf set, 'backupPool' must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy VMs in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where 'failoverRatio' is not set or all the VMs in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy VMs with the best effort, or to all VMs when no VM is healthy.", + "description": "This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1].\n\nIf set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool.\n\nIn case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the \"force\" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.", "format": "float" }, "healthChecks": { "type": "array", - "description": "A list of URLs to the HttpHealthCheck resource. A member VM in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member VMs will be considered healthy at all times.", + "description": "A list of URLs to the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if all specified health checks pass. An empty list means all member instances will be considered healthy at all times.", "items": { "type": "string" } }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource; defined by the server.", "format": "uint64" }, "instances": { "type": "array", - "description": "A list of resource URLs to the member VMs serving this pool. They must live in zones contained in the same region as this pool.", + "description": "A list of resource URLs to the member virtual machines serving this pool. They must live in zones contained in the same region as this pool.", "items": { "type": "string" } @@ -3851,20 +5204,20 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "region": { "type": "string", - "description": "URL of the region where the target pool resides (output only)." + "description": "[Output Only] URL of the region where the target pool resides." }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "sessionAffinity": { "type": "string", - "description": "Sesssion affinity option, must be one of the following values: 'NONE': Connections from the same client IP may go to any VM in the pool; 'CLIENT_IP': Connections from the same client IP will go to the same VM in the pool while that VM remains healthy. 'CLIENT_IP_PROTO': Connections from the same client IP with the same IP protocol will go to the same VM in the pool while that VM remains healthy.", + "description": "Sesssion affinity option, must be one of the following values:\nNONE: Connections from the same client IP may go to any instance in the pool.\nCLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy.\nCLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy.", "enum": [ "CLIENT_IP", "CLIENT_IP_PROTO", @@ -3884,7 +5237,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "object", @@ -3901,11 +5254,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -3933,7 +5286,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Defined by the server." }, "items": { "type": "array", @@ -3949,11 +5302,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -4125,7 +5478,7 @@ }, "name": { "type": "string", - "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -4338,7 +5691,7 @@ "properties": { "creationTimestamp": { "type": "string", - "description": "Creation timestamp in RFC3339 text format (output only)." + "description": "[Output Only] Creation timestamp in RFC3339 text format." }, "defaultService": { "type": "string", @@ -4346,7 +5699,7 @@ }, "description": { "type": "string", - "description": "An optional textual description of the resource; provided by the client when the resource is created." + "description": "An optional textual description of the resource. Provided by the client when the resource is created." }, "fingerprint": { "type": "string", @@ -4362,7 +5715,7 @@ }, "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only).", + "description": "[Output Only] Unique identifier for the resource. Set by the server.", "format": "uint64" }, "kind": { @@ -4372,7 +5725,7 @@ }, "name": { "type": "string", - "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.", + "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?" }, "pathMatchers": { @@ -4384,7 +5737,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for the resource (output only)." + "description": "[Output Only] Server-defined URL for the resource." }, "tests": { "type": "array", @@ -4402,7 +5755,7 @@ "properties": { "id": { "type": "string", - "description": "Unique identifier for the resource; defined by the server (output only)." + "description": "[Output Only] Unique identifier for the resource. Set by the server." }, "items": { "type": "array", @@ -4418,11 +5771,11 @@ }, "nextPageToken": { "type": "string", - "description": "A token used to continue a truncated list request (output only)." + "description": "[Output Only] A token used to continue a truncated list request." }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -4540,13 +5893,6 @@ "description": "[Output Only] Unique identifier for the resource. Defined by the server.", "format": "uint64" }, - "ikeNetworks": { - "type": "array", - "description": "IKE networks to use when establishing the VPN tunnel with peer VPN gateway. The value should be a CIDR formatted string, for example: 192.168.0.0/16. The ranges should be disjoint.", - "items": { - "type": "string" - } - }, "ikeVersion": { "type": "integer", "description": "IKE protocol version to use when establishing the VPN tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2.", @@ -4559,7 +5905,7 @@ }, "name": { "type": "string", - "description": "Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long and comply with RFC1035.", + "description": "Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.", "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "annotations": { "required": [ @@ -4577,7 +5923,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "sharedSecret": { "type": "string", @@ -4655,7 +6001,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for this resource." + "description": "[Output Only] Server-defined URL for this resource." } } }, @@ -4828,7 +6174,7 @@ }, "selfLink": { "type": "string", - "description": "[Output Only] Server defined URL for the resource." + "description": "[Output Only] Server-defined URL for the resource." }, "status": { "type": "string", @@ -4871,7 +6217,7 @@ }, "selfLink": { "type": "string", - "description": "Server defined URL for this resource (output only)." + "description": "[Output Only] Server-defined URL for this resource." } } } @@ -4887,7 +6233,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -4901,7 +6247,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5051,7 +6397,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5065,7 +6411,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5098,6 +6444,313 @@ } } }, + "autoscalers": { + "methods": { + "aggregatedList": { + "id": "compute.autoscalers.aggregatedList", + "path": "{project}/aggregated/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscalers grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "AutoscalerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.autoscalers.delete", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "DELETE", + "description": "Deletes the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.autoscalers.get", + "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + "httpMethod": "GET", + "description": "Returns the specified autoscaler resource.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the persistent autoscaler resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "response": { + "$ref": "Autoscaler" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.autoscalers.insert", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "POST", + "description": "Creates an autoscaler resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.autoscalers.list", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "GET", + "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "AutoscalerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.autoscalers.patch", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PATCH", + "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "autoscaler" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.autoscalers.update", + "path": "{project}/zones/{zone}/autoscalers", + "httpMethod": "PUT", + "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + "parameters": { + "autoscaler": { + "type": "string", + "description": "Name of the autoscaler resource to update.", + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "Name of the zone scoping this request.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "Autoscaler" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, "backendServices": { "methods": { "delete": { @@ -5239,7 +6892,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5253,7 +6906,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5360,7 +7013,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5374,7 +7027,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5447,7 +7100,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5461,7 +7114,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5504,7 +7157,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5518,7 +7171,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5589,7 +7242,7 @@ "id": "compute.disks.delete", "path": "{project}/zones/{zone}/disks/{disk}", "httpMethod": "DELETE", - "description": "Deletes the specified persistent disk.", + "description": "Deletes the specified persistent disk. Deleting a disk removes 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.", "parameters": { "disk": { "type": "string", @@ -5717,7 +7370,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5731,7 +7384,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5869,7 +7522,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -5883,7 +7536,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -5990,7 +7643,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6004,7 +7657,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6154,7 +7807,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6168,7 +7821,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6203,7 +7856,7 @@ "id": "compute.forwardingRules.setTarget", "path": "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget", "httpMethod": "POST", - "description": "Changes target url for forwarding rule.", + "description": "Changes target url for forwarding rule. The new target should be of the same type as the old target.", "parameters": { "forwardingRule": { "type": "string", @@ -6350,7 +8003,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6364,7 +8017,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6494,7 +8147,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6508,7 +8161,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6535,7 +8188,7 @@ "id": "compute.globalForwardingRules.setTarget", "path": "{project}/global/forwardingRules/{forwardingRule}/setTarget", "httpMethod": "POST", - "description": "Changes target url for forwarding rule.", + "description": "Changes target url for forwarding rule. The new target should be of the same type as the old target.", "parameters": { "forwardingRule": { "type": "string", @@ -6579,7 +8232,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6593,7 +8246,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6620,11 +8273,11 @@ "id": "compute.globalOperations.delete", "path": "{project}/global/operations/{operation}", "httpMethod": "DELETE", - "description": "Deletes the specified operation resource.", + "description": "Deletes the specified Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -6650,11 +8303,11 @@ "id": "compute.globalOperations.get", "path": "{project}/global/operations/{operation}", "httpMethod": "GET", - "description": "Retrieves the specified operation resource.", + "description": "Retrieves the specified Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -6684,11 +8337,11 @@ "id": "compute.globalOperations.list", "path": "{project}/global/operations", "httpMethod": "GET", - "description": "Retrieves the list of operation resources contained within the specified project.", + "description": "Retrieves the list of Operation resources contained within the specified project.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6702,7 +8355,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6832,7 +8485,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -6846,7 +8499,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -6943,6 +8596,222 @@ } } }, + "httpsHealthChecks": { + "methods": { + "delete": { + "id": "compute.httpsHealthChecks.delete", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "DELETE", + "description": "Deletes the specified HttpsHealthCheck resource.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "httpsHealthCheck" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.httpsHealthChecks.get", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "GET", + "description": "Returns the specified HttpsHealthCheck resource.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "httpsHealthCheck" + ], + "response": { + "$ref": "HttpsHealthCheck" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.httpsHealthChecks.insert", + "path": "{project}/global/httpsHealthChecks", + "httpMethod": "POST", + "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.httpsHealthChecks.list", + "path": "{project}/global/httpsHealthChecks", + "httpMethod": "GET", + "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "HttpsHealthCheckList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "patch": { + "id": "compute.httpsHealthChecks.patch", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "PATCH", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "httpsHealthCheck" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "update": { + "id": "compute.httpsHealthChecks.update", + "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + "httpMethod": "PUT", + "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.", + "parameters": { + "httpsHealthCheck": { + "type": "string", + "description": "Name of the HttpsHealthCheck resource to update.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "httpsHealthCheck" + ], + "request": { + "$ref": "HttpsHealthCheck" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, "images": { "methods": { "delete": { @@ -7083,11 +8952,11 @@ "id": "compute.images.list", "path": "{project}/global/images", "httpMethod": "GET", - "description": "Retrieves the list of image resources available to the specified project.", + "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 7. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.\n\nSee Accessing images for more information.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -7101,7 +8970,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7126,6 +8995,921 @@ } } }, + "instanceGroupManagers": { + "methods": { + "abandonInstances": { + "id": "compute.instanceGroupManagers.abandonInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + "httpMethod": "POST", + "description": "Schedules a group action to remove the specified instances 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.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersAbandonInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroupManagers.aggregatedList", + "path": "{project}/aggregated/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves the list of managed instance groups and groups them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InstanceGroupManagerAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroupManagers.delete", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "DELETE", + "description": "Deletes the specified managed instance group and all of the instances in that group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "deleteInstances": { + "id": "compute.instanceGroupManagers.deleteInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + "httpMethod": "POST", + "description": "Schedules a group action to delete the specified instances in the managed instance group. 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. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersDeleteInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroupManagers.get", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + "httpMethod": "GET", + "description": "Returns all of the details about the specified managed instance group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManager" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroupManagers.insert", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "POST", + "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where you want to create the managed instance group.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroupManager" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroupManagers.list", + "path": "{project}/zones/{zone}/instanceGroupManagers", + "httpMethod": "GET", + "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupManagerList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listManagedInstances": { + "id": "compute.instanceGroupManagers.listManagedInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + "httpMethod": "POST", + "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "response": { + "$ref": "InstanceGroupManagersListManagedInstancesResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "recreateInstances": { + "id": "compute.instanceGroupManagers.recreateInstances", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + "httpMethod": "POST", + "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersRecreateInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "resize": { + "id": "compute.instanceGroupManagers.resize", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + "httpMethod": "POST", + "description": "Resizes 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 instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "size": { + "type": "integer", + "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + "required": true, + "format": "int32", + "location": "query" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager", + "size" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setInstanceTemplate": { + "id": "compute.instanceGroupManagers.setInstanceTemplate", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + "httpMethod": "POST", + "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 recreate them.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setTargetPools": { + "id": "compute.instanceGroupManagers.setTargetPools", + "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + "httpMethod": "POST", + "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.", + "parameters": { + "instanceGroupManager": { + "type": "string", + "description": "The name of the managed instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the managed instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroupManager" + ], + "request": { + "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "instanceGroups": { + "methods": { + "addInstances": { + "id": "compute.instanceGroups.addInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + "httpMethod": "POST", + "description": "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.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where you are adding instances.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsAddInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "aggregatedList": { + "id": "compute.instanceGroups.aggregatedList", + "path": "{project}/aggregated/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups and sorts them by zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "InstanceGroupAggregatedList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "delete": { + "id": "compute.instanceGroups.delete", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "DELETE", + "description": "Deletes the specified instance group. The instances in the group are not deleted.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group to delete.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.instanceGroups.get", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + "httpMethod": "GET", + "description": "Returns the specified instance group resource.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "response": { + "$ref": "InstanceGroup" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.instanceGroups.insert", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "POST", + "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where you want to create the instance group.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "request": { + "$ref": "InstanceGroup" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.instanceGroups.list", + "path": "{project}/zones/{zone}/instanceGroups", + "httpMethod": "GET", + "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone" + ], + "response": { + "$ref": "InstanceGroupList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "listInstances": { + "id": "compute.instanceGroups.listInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + "httpMethod": "POST", + "description": "Lists the instances in the specified instance group.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "instanceGroup": { + "type": "string", + "description": "The name of the instance group from which you want to generate a list of included instances.", + "required": true, + "location": "path" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsListInstancesRequest" + }, + "response": { + "$ref": "InstanceGroupsListInstances" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "removeInstances": { + "id": "compute.instanceGroups.removeInstances", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + "httpMethod": "POST", + "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the specified instances will be removed.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsRemoveInstancesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setNamedPorts": { + "id": "compute.instanceGroups.setNamedPorts", + "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + "httpMethod": "POST", + "description": "Sets the named ports for the specified instance group.", + "parameters": { + "instanceGroup": { + "type": "string", + "description": "The name of the instance group where the named ports are updated.", + "required": true, + "location": "path" + }, + "project": { + "type": "string", + "description": "The project ID for this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "zone": { + "type": "string", + "description": "The name of the zone where the instance group is located.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "project", + "zone", + "instanceGroup" + ], + "request": { + "$ref": "InstanceGroupsSetNamedPortsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, "instanceTemplates": { "methods": { "delete": { @@ -7231,7 +10015,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -7245,7 +10029,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7327,10 +10111,11 @@ "id": "compute.instances.aggregatedList", "path": "{project}/aggregated/instances", "httpMethod": "GET", + "description": "Retrieves aggregated list of instance resources.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -7344,7 +10129,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -7578,7 +10363,7 @@ }, "zone": { "type": "string", - "description": "The name of the The name of the zone for this request..", + "description": "The name of the zone for this request.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -7613,7 +10398,7 @@ }, "port": { "type": "integer", - "description": "Which COM port to retrieve data from.", + "description": "Specifies which COM or serial port to retrieve data from.", "default": "1", "format": "int32", "minimum": "1", @@ -7693,7 +10478,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -7707,7 +10492,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8099,7 +10884,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8113,7 +10898,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8186,7 +10971,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8200,7 +10985,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8338,7 +11123,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8352,7 +11137,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8528,11 +11313,11 @@ "id": "compute.regionOperations.delete", "path": "{project}/regions/{region}/operations/{operation}", "httpMethod": "DELETE", - "description": "Deletes the specified region-specific operation resource.", + "description": "Deletes the specified region-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8566,11 +11351,11 @@ "id": "compute.regionOperations.get", "path": "{project}/regions/{region}/operations/{operation}", "httpMethod": "GET", - "description": "Retrieves the specified region-specific operation resource.", + "description": "Retrieves the specified region-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8608,11 +11393,11 @@ "id": "compute.regionOperations.list", "path": "{project}/regions/{region}/operations", "httpMethod": "GET", - "description": "Retrieves the list of operation resources contained within the specified region.", + "description": "Retrieves the list of Operation resources contained within the specified region.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8626,7 +11411,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8703,7 +11488,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8717,7 +11502,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8847,7 +11632,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8861,7 +11646,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -8892,7 +11677,7 @@ "id": "compute.snapshots.delete", "path": "{project}/global/snapshots/{snapshot}", "httpMethod": "DELETE", - "description": "Deletes the specified persistent disk snapshot resource.", + "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", "parameters": { "project": { "type": "string", @@ -8903,7 +11688,7 @@ }, "snapshot": { "type": "string", - "description": "Name of the persistent disk snapshot resource to delete.", + "description": "Name of the Snapshot resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8925,7 +11710,7 @@ "id": "compute.snapshots.get", "path": "{project}/global/snapshots/{snapshot}", "httpMethod": "GET", - "description": "Returns the specified persistent disk snapshot resource.", + "description": "Returns the specified Snapshot resource.", "parameters": { "project": { "type": "string", @@ -8936,7 +11721,7 @@ }, "snapshot": { "type": "string", - "description": "Name of the persistent disk snapshot resource to return.", + "description": "Name of the Snapshot resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -8959,11 +11744,11 @@ "id": "compute.snapshots.list", "path": "{project}/global/snapshots", "httpMethod": "GET", - "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + "description": "Retrieves the list of Snapshot resources contained within the specified project.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -8977,7 +11762,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9002,6 +11787,150 @@ } } }, + "sslCertificates": { + "methods": { + "delete": { + "id": "compute.sslCertificates.delete", + "path": "{project}/global/sslCertificates/{sslCertificate}", + "httpMethod": "DELETE", + "description": "Deletes the specified SslCertificate resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "sslCertificate": { + "type": "string", + "description": "Name of the SslCertificate resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslCertificate" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.sslCertificates.get", + "path": "{project}/global/sslCertificates/{sslCertificate}", + "httpMethod": "GET", + "description": "Returns the specified SslCertificate resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "sslCertificate": { + "type": "string", + "description": "Name of the SslCertificate resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "sslCertificate" + ], + "response": { + "$ref": "SslCertificate" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.sslCertificates.insert", + "path": "{project}/global/sslCertificates", + "httpMethod": "POST", + "description": "Creates a SslCertificate resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "SslCertificate" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.sslCertificates.list", + "path": "{project}/global/sslCertificates", + "httpMethod": "GET", + "description": "Retrieves the list of SslCertificate resources available to the specified project.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "SslCertificateList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + } + } + }, "targetHttpProxies": { "methods": { "delete": { @@ -9107,7 +12036,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -9121,7 +12050,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9182,17 +12111,112 @@ } } }, - "targetInstances": { + "targetHttpsProxies": { "methods": { - "aggregatedList": { - "id": "compute.targetInstances.aggregatedList", - "path": "{project}/aggregated/targetInstances", + "delete": { + "id": "compute.targetHttpsProxies.delete", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + "httpMethod": "DELETE", + "description": "Deletes the specified TargetHttpsProxy resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to delete.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "get": { + "id": "compute.targetHttpsProxies.get", + "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", "httpMethod": "GET", - "description": "Retrieves the list of target instances grouped by scope.", + "description": "Returns the specified TargetHttpsProxy resource.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource to return.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "response": { + "$ref": "TargetHttpsProxy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "insert": { + "id": "compute.targetHttpsProxies.insert", + "path": "{project}/global/targetHttpsProxies", + "httpMethod": "POST", + "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "TargetHttpsProxy" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "list": { + "id": "compute.targetHttpsProxies.list", + "path": "{project}/global/targetHttpsProxies", + "httpMethod": "GET", + "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -9206,7 +12230,128 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + "location": "query" + }, + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + } + }, + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "TargetHttpsProxyList" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" + ] + }, + "setSslCertificates": { + "id": "compute.targetHttpsProxies.setSslCertificates", + "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", + "httpMethod": "POST", + "description": "Replaces SslCertificates for TargetHttpsProxy.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "request": { + "$ref": "TargetHttpsProxiesSetSslCertificatesRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + }, + "setUrlMap": { + "id": "compute.targetHttpsProxies.setUrlMap", + "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", + "httpMethod": "POST", + "description": "Changes the URL map for TargetHttpsProxy.", + "parameters": { + "project": { + "type": "string", + "description": "Name of the project scoping this request.", + "required": true, + "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + "location": "path" + }, + "targetHttpsProxy": { + "type": "string", + "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.", + "required": true, + "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + "location": "path" + } + }, + "parameterOrder": [ + "project", + "targetHttpsProxy" + ], + "request": { + "$ref": "UrlMapReference" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/compute" + ] + } + } + }, + "targetInstances": { + "methods": { + "aggregatedList": { + "id": "compute.targetInstances.aggregatedList", + "path": "{project}/aggregated/targetInstances", + "httpMethod": "GET", + "description": "Retrieves the list of target instances grouped by scope.", + "parameters": { + "filter": { + "type": "string", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum count of results to be returned.", + "default": "500", + "format": "uint32", + "minimum": "0", + "maximum": "500", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9356,7 +12501,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -9370,7 +12515,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9499,7 +12644,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -9513,7 +12658,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9707,7 +12852,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -9721,7 +12866,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -9900,7 +13045,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -9914,7 +13059,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10064,7 +13209,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -10078,7 +13223,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10216,7 +13361,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -10230,7 +13375,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10373,7 +13518,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -10387,7 +13532,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10537,7 +13682,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -10551,7 +13696,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10590,11 +13735,11 @@ "id": "compute.zoneOperations.delete", "path": "{project}/zones/{zone}/operations/{operation}", "httpMethod": "DELETE", - "description": "Deletes the specified zone-specific operation resource.", + "description": "Deletes the specified zone-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to delete.", + "description": "Name of the Operations resource to delete.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -10628,11 +13773,11 @@ "id": "compute.zoneOperations.get", "path": "{project}/zones/{zone}/operations/{operation}", "httpMethod": "GET", - "description": "Retrieves the specified zone-specific operation resource.", + "description": "Retrieves the specified zone-specific Operations resource.", "parameters": { "operation": { "type": "string", - "description": "Name of the operation resource to return.", + "description": "Name of the Operations resource to return.", "required": true, "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", "location": "path" @@ -10670,11 +13815,11 @@ "id": "compute.zoneOperations.list", "path": "{project}/zones/{zone}/operations", "httpMethod": "GET", - "description": "Retrieves the list of operation resources contained within the specified zone.", + "description": "Retrieves the list of Operation resources contained within the specified zone.", "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -10688,7 +13833,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { @@ -10765,7 +13910,7 @@ "parameters": { "filter": { "type": "string", - "description": "Filter expression for filtering listed resources.", + "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", "location": "query" }, "maxResults": { @@ -10779,7 +13924,7 @@ }, "pageToken": { "type": "string", - "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", "location": "query" }, "project": { 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 d5cd944676..7a7c539c36 100644 --- a/vendor/google.golang.org/api/compute/v1/compute-gen.go +++ b/vendor/google.golang.org/api/compute/v1/compute-gen.go @@ -14,8 +14,10 @@ import ( "encoding/json" "errors" "fmt" - "golang.org/x/net/context" - "google.golang.org/api/googleapi" + context "golang.org/x/net/context" + ctxhttp "golang.org/x/net/context/ctxhttp" + gensupport "google.golang.org/api/gensupport" + googleapi "google.golang.org/api/googleapi" "io" "net/http" "net/url" @@ -31,10 +33,12 @@ var _ = fmt.Sprintf var _ = json.NewDecoder var _ = io.Copy var _ = url.Parse +var _ = gensupport.MarshalJSON var _ = googleapi.Version var _ = errors.New var _ = strings.Replace -var _ = context.Background +var _ = context.Canceled +var _ = ctxhttp.Do const apiId = "compute:v1" const apiName = "compute" @@ -68,6 +72,7 @@ func New(client *http.Client) (*Service, error) { } s := &Service{client: client, BasePath: basePath} s.Addresses = NewAddressesService(s) + s.Autoscalers = NewAutoscalersService(s) s.BackendServices = NewBackendServicesService(s) s.DiskTypes = NewDiskTypesService(s) s.Disks = NewDisksService(s) @@ -77,7 +82,10 @@ func New(client *http.Client) (*Service, error) { s.GlobalForwardingRules = NewGlobalForwardingRulesService(s) s.GlobalOperations = NewGlobalOperationsService(s) s.HttpHealthChecks = NewHttpHealthChecksService(s) + s.HttpsHealthChecks = NewHttpsHealthChecksService(s) s.Images = NewImagesService(s) + s.InstanceGroupManagers = NewInstanceGroupManagersService(s) + s.InstanceGroups = NewInstanceGroupsService(s) s.InstanceTemplates = NewInstanceTemplatesService(s) s.Instances = NewInstancesService(s) s.Licenses = NewLicensesService(s) @@ -88,7 +96,9 @@ func New(client *http.Client) (*Service, error) { s.Regions = NewRegionsService(s) s.Routes = NewRoutesService(s) s.Snapshots = NewSnapshotsService(s) + s.SslCertificates = NewSslCertificatesService(s) s.TargetHttpProxies = NewTargetHttpProxiesService(s) + s.TargetHttpsProxies = NewTargetHttpsProxiesService(s) s.TargetInstances = NewTargetInstancesService(s) s.TargetPools = NewTargetPoolsService(s) s.TargetVpnGateways = NewTargetVpnGatewaysService(s) @@ -106,6 +116,8 @@ type Service struct { Addresses *AddressesService + Autoscalers *AutoscalersService + BackendServices *BackendServicesService DiskTypes *DiskTypesService @@ -124,8 +136,14 @@ type Service struct { HttpHealthChecks *HttpHealthChecksService + HttpsHealthChecks *HttpsHealthChecksService + Images *ImagesService + InstanceGroupManagers *InstanceGroupManagersService + + InstanceGroups *InstanceGroupsService + InstanceTemplates *InstanceTemplatesService Instances *InstancesService @@ -146,8 +164,12 @@ type Service struct { Snapshots *SnapshotsService + SslCertificates *SslCertificatesService + TargetHttpProxies *TargetHttpProxiesService + TargetHttpsProxies *TargetHttpsProxiesService + TargetInstances *TargetInstancesService TargetPools *TargetPoolsService @@ -179,6 +201,15 @@ type AddressesService struct { s *Service } +func NewAutoscalersService(s *Service) *AutoscalersService { + rs := &AutoscalersService{s: s} + return rs +} + +type AutoscalersService struct { + s *Service +} + func NewBackendServicesService(s *Service) *BackendServicesService { rs := &BackendServicesService{s: s} return rs @@ -260,6 +291,15 @@ type HttpHealthChecksService struct { s *Service } +func NewHttpsHealthChecksService(s *Service) *HttpsHealthChecksService { + rs := &HttpsHealthChecksService{s: s} + return rs +} + +type HttpsHealthChecksService struct { + s *Service +} + func NewImagesService(s *Service) *ImagesService { rs := &ImagesService{s: s} return rs @@ -269,6 +309,24 @@ type ImagesService struct { s *Service } +func NewInstanceGroupManagersService(s *Service) *InstanceGroupManagersService { + rs := &InstanceGroupManagersService{s: s} + return rs +} + +type InstanceGroupManagersService struct { + s *Service +} + +func NewInstanceGroupsService(s *Service) *InstanceGroupsService { + rs := &InstanceGroupsService{s: s} + return rs +} + +type InstanceGroupsService struct { + s *Service +} + func NewInstanceTemplatesService(s *Service) *InstanceTemplatesService { rs := &InstanceTemplatesService{s: s} return rs @@ -359,6 +417,15 @@ type SnapshotsService struct { s *Service } +func NewSslCertificatesService(s *Service) *SslCertificatesService { + rs := &SslCertificatesService{s: s} + return rs +} + +type SslCertificatesService struct { + s *Service +} + func NewTargetHttpProxiesService(s *Service) *TargetHttpProxiesService { rs := &TargetHttpProxiesService{s: s} return rs @@ -368,6 +435,15 @@ type TargetHttpProxiesService struct { s *Service } +func NewTargetHttpsProxiesService(s *Service) *TargetHttpsProxiesService { + rs := &TargetHttpsProxiesService{s: s} + return rs +} + +type TargetHttpsProxiesService struct { + s *Service +} + func NewTargetInstancesService(s *Service) *TargetInstancesService { rs := &TargetInstancesService{s: s} return rs @@ -431,6 +507,8 @@ type ZonesService struct { s *Service } +// AccessConfig: An access configuration attached to an instance's +// network interface. type AccessConfig struct { // Kind: [Output Only] Type of the resource. Always compute#accessConfig // for access configs. @@ -452,8 +530,23 @@ type AccessConfig struct { // Possible values: // "ONE_TO_ONE_NAT" (default) Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Kind") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *AccessConfig) MarshalJSON() ([]byte, error) { + type noMethod AccessConfig + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Address: A reserved address resource. type Address struct { // Address: The static external IP address represented by this resource. Address string `json:"address,omitempty"` @@ -487,7 +580,7 @@ type Address struct { // resides. This field is not applicable to global addresses. Region string `json:"region,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // Status: [Output Only] The status of the address, which can be either @@ -503,6 +596,24 @@ type Address struct { // Users: [Output Only] The URLs of the resources that are using this // address. Users []string `json:"users,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Address") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Address) MarshalJSON() ([]byte, error) { + type noMethod Address + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type AddressAggregatedList struct { @@ -521,10 +632,29 @@ type AddressAggregatedList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *AddressAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod AddressAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AddressList: Contains a list of address resources. type AddressList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -541,8 +671,26 @@ type AddressList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressList) MarshalJSON() ([]byte, error) { + type noMethod AddressList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type AddressesScopedList struct { @@ -552,8 +700,24 @@ type AddressesScopedList struct { // Warning: [Output Only] Informational warning which replaces the list // of addresses when the list is empty. Warning *AddressesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Addresses") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *AddressesScopedList) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AddressesScopedListWarning: [Output Only] Informational warning which +// replaces the list of addresses when the list is empty. type AddressesScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -580,6 +744,20 @@ type AddressesScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AddressesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type AddressesScopedListWarningData struct { @@ -588,8 +766,23 @@ type AddressesScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *AddressesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod AddressesScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachedDisk: An instance-attached disk resource. type AttachedDisk struct { // AutoDelete: Specifies whether the disk will be auto-deleted when the // instance is deleted (but not when the disk is detached from the @@ -601,9 +794,10 @@ type AttachedDisk struct { Boot bool `json:"boot,omitempty"` // DeviceName: Specifies a unique device name of your choice that is - // reflected into the /dev/ tree of a Linux operating system running - // within the instance. This name can be used to reference the device - // for mounting, resizing, and so on, from within the instance. + // reflected into the /dev/disk/by-id/google-* tree of a Linux operating + // system running within the instance. This name can be used to + // reference the device for mounting, resizing, and so on, from within + // the instance. // // If not specified, the server chooses a default device name to apply // to this disk, in the form persistent-disks-x, where x is a number @@ -626,6 +820,10 @@ type AttachedDisk struct { // only define one or the other, but not both. InitializeParams *AttachedDiskInitializeParams `json:"initializeParams,omitempty"` + // Interface: Specifies the disk interface to use for attaching this + // disk, either SCSI or NVME. The default is SCSI. For performance + // characteristics of SCSI over NVMe, see Local SSD performance. + // // Possible values: // "NVME" // "SCSI" @@ -659,8 +857,29 @@ type AttachedDisk struct { // "PERSISTENT" // "SCRATCH" Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutoDelete") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *AttachedDisk) MarshalJSON() ([]byte, error) { + type noMethod AttachedDisk + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AttachedDiskInitializeParams: [Input Only] Specifies the parameters +// for a new disk that will be created alongside the new instance. Use +// initialization parameters to create boot disks or local SSDs attached +// to the new instance. +// +// This property is mutually exclusive with the source property; you can +// only define one or the other, but not both. type AttachedDiskInitializeParams struct { // DiskName: Specifies the disk name. If not specified, the default is // to use the name of the instance. @@ -681,8 +900,7 @@ type AttachedDiskInitializeParams struct { // you can provide either the full or partial URL. For example, the // following are valid values: // - - // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk - // Types/diskType + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType // - projects/project/zones/zone/diskTypes/diskType // - zones/zone/diskTypes/diskType DiskType string `json:"diskType,omitempty"` @@ -704,32 +922,414 @@ type AttachedDiskInitializeParams struct { // where vYYYYMMDD is the image version. The fully-qualified URL will // also work in both cases. SourceImage string `json:"sourceImage,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *AttachedDiskInitializeParams) MarshalJSON() ([]byte, error) { + type noMethod AttachedDiskInitializeParams + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type Autoscaler struct { + // AutoscalingPolicy: Autoscaling configuration. + AutoscalingPolicy *AutoscalingPolicy `json:"autoscalingPolicy,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. Provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // Target: URL of Instance Group Manager or Replica Pool which will be + // controlled by Autoscaler. + Target string `json:"target,omitempty"` + + // Zone: [Output Only] URL of the zone where the instance group resides. + 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. "AutoscalingPolicy") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Autoscaler) MarshalJSON() ([]byte, error) { + type noMethod Autoscaler + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalerAggregatedList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A map of scoped autoscaler lists. + Items map[string]AutoscalersScopedList `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalerList: Contains a list of persistent autoscaler resources. +type AutoscalerList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of Autoscaler resources. + Items []*Autoscaler `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalerList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalerList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalersScopedList struct { + // Autoscalers: List of autoscalers contained in this scope. + Autoscalers []*Autoscaler `json:"autoscalers,omitempty"` + + // Warning: Informational warning which replaces the list of autoscalers + // when the list is empty. + Warning *AutoscalersScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Autoscalers") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedList) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalersScopedListWarning: Informational warning which replaces +// the list of autoscalers when the list is empty. +type AutoscalersScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "DEPRECATED_RESOURCE_USED" + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" + // "INJECTED_KERNELS_DEPRECATED" + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" + // "NEXT_HOP_CANNOT_IP_FORWARD" + // "NEXT_HOP_INSTANCE_NOT_FOUND" + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" + // "NEXT_HOP_NOT_RUNNING" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*AutoscalersScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type AutoscalersScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalersScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod AutoscalersScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicy: Cloud Autoscaler policy. +type AutoscalingPolicy struct { + // CoolDownPeriodSec: The number of seconds that the Autoscaler should + // wait between two succeeding changes to the number of virtual + // machines. You should define an interval that is at least as long as + // the initialization time of a virtual machine and the time it may take + // for replica pool to create the virtual machine. The default is 60 + // seconds. + CoolDownPeriodSec int64 `json:"coolDownPeriodSec,omitempty"` + + // CpuUtilization: TODO(jbartosik): Add support for scaling based on + // muliple utilization metrics (take max recommendation). Exactly one + // utilization policy should be provided. Configuration parameters of + // CPU based autoscaling policy. + CpuUtilization *AutoscalingPolicyCpuUtilization `json:"cpuUtilization,omitempty"` + + // CustomMetricUtilizations: Configuration parameters of autoscaling + // based on custom metric. + CustomMetricUtilizations []*AutoscalingPolicyCustomMetricUtilization `json:"customMetricUtilizations,omitempty"` + + // LoadBalancingUtilization: Configuration parameters of autoscaling + // based on load balancer. + LoadBalancingUtilization *AutoscalingPolicyLoadBalancingUtilization `json:"loadBalancingUtilization,omitempty"` + + // MaxNumReplicas: The maximum number of replicas that the Autoscaler + // can scale up to. This field is required for config to be effective. + // Maximum number of replicas should be not lower than minimal number of + // replicas. Absolute limit for this value is defined in Autoscaler + // backend. + MaxNumReplicas int64 `json:"maxNumReplicas,omitempty"` + + // MinNumReplicas: The minimum number of replicas that the Autoscaler + // can scale down to. Can't be less than 0. If not provided Autoscaler + // will choose default value depending on maximal number of replicas. + MinNumReplicas int64 `json:"minNumReplicas,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CoolDownPeriodSec") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicy + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCpuUtilization: CPU utilization policy. +type AutoscalingPolicyCpuUtilization struct { + // UtilizationTarget: The target utilization that the Autoscaler should + // maintain. It is represented as a fraction of used cores. For example: + // 6 cores used in 8-core VM are represented here as 0.75. Must be a + // float value between (0, 1]. If not defined, the default is 0.8. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCpuUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCpuUtilization + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyCustomMetricUtilization: Custom utilization metric +// policy. +type AutoscalingPolicyCustomMetricUtilization struct { + // Metric: Identifier of the metric. It should be a Cloud Monitoring + // metric. The metric can not have negative values. The metric should be + // an utilization metric (increasing number of VMs handling requests x + // times should reduce average value of the metric roughly x times). For + // example you could use: + // compute.googleapis.com/instance/network/received_bytes_count. + Metric string `json:"metric,omitempty"` + + // UtilizationTarget: Target value of the metric which Autoscaler should + // maintain. Must be a positive value. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // UtilizationTargetType: Defines type in which utilization_target is + // expressed. + // + // Possible values: + // "DELTA_PER_MINUTE" + // "DELTA_PER_SECOND" + // "GAUGE" + UtilizationTargetType string `json:"utilizationTargetType,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Metric") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyCustomMetricUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyCustomMetricUtilization + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// AutoscalingPolicyLoadBalancingUtilization: Load balancing utilization +// policy. +type AutoscalingPolicyLoadBalancingUtilization struct { + // UtilizationTarget: Fraction of backend capacity utilization (set in + // HTTP load balancing configuration) that Autoscaler should maintain. + // Must be a positive float value. If not defined, the default is 0.8. + // For example if your maxRatePerInstance capacity (in HTTP Load + // Balancing configuration) is set at 10 and you would like to keep + // number of instances such that each instance receives 7 QPS on + // average, set this to 0.7. + UtilizationTarget float64 `json:"utilizationTarget,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UtilizationTarget") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *AutoscalingPolicyLoadBalancingUtilization) MarshalJSON() ([]byte, error) { + type noMethod AutoscalingPolicyLoadBalancingUtilization + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Backend: Message containing information of one individual backend. type Backend struct { - // BalancingMode: The balancing mode of this backend, default is - // UTILIZATION. + // BalancingMode: Specifies the balancing mode for this backend. The + // default is UTILIZATION but available values are UTILIZATION and RATE. // // Possible values: // "RATE" // "UTILIZATION" BalancingMode string `json:"balancingMode,omitempty"` - // CapacityScaler: The multiplier (a value between 0.0 and 1.0) of the - // max capacity (CPU or RPS, depending on 'balancingMode') the group - // should serve up to. 0 means the group is totally drained. Default - // value is 1. Valid range is [0.0, 1.0]. + // CapacityScaler: A multiplier applied to the group's maximum servicing + // capacity (either UTILIZATION or RATE). Default value is 1, which + // means the group will serve up to 100% of its configured CPU or RPS + // (depending on balancingMode). A setting of 0 means the group is + // completely drained, offering 0% of its available CPU or RPS. Valid + // range is [0.0,1.0]. CapacityScaler float64 `json:"capacityScaler,omitempty"` - // Description: An optional textual description of the resource, which - // is provided by the client when the resource is created. + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. Description string `json:"description,omitempty"` - // Group: URL of a zonal Cloud Resource View resource. This resource - // view defines the list of instances that serve traffic. Member virtual - // machine instances from each resource view must live in the same zone - // as the resource view itself. No two backends in a backend service are - // allowed to use same Resource View resource. + // Group: The fully-qualified URL of a zonal Instance Group resource. + // This instance group defines the list of instances that serve traffic. + // Member virtual machine instances from each instance group must live + // in the same zone as the instance group itself. No two backends in a + // backend service are allowed to use same Instance Group + // resource. + // + // Note that you must specify an Instance Group resource using the + // fully-qualified URL, rather than a partial URL. Group string `json:"group,omitempty"` // MaxRate: The max RPS of the group. Can be used with either balancing @@ -743,22 +1343,39 @@ type Backend struct { // maxRatePerInstance must be set. MaxRatePerInstance float64 `json:"maxRatePerInstance,omitempty"` - // MaxUtilization: Used when 'balancingMode' is UTILIZATION. This ratio + // MaxUtilization: Used when balancingMode is UTILIZATION. This ratio // defines the CPU utilization target for the group. The default is 0.8. - // Valid range is [0, 1]. + // Valid range is [0.0, 1.0]. MaxUtilization float64 `json:"maxUtilization,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BalancingMode") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *Backend) MarshalJSON() ([]byte, error) { + type noMethod Backend + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// BackendService: A BackendService resource. This resource defines a +// group of backend virtual machines together with their serving +// capacity. type BackendService struct { // Backends: The list of backends that serve this BackendService. Backends []*Backend `json:"backends,omitempty"` - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` - // Description: An optional textual description of the resource; - // provided by the client when the resource is created. + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. Description string `json:"description,omitempty"` // Fingerprint: Fingerprint of this resource. A hash of the contents @@ -767,24 +1384,30 @@ type BackendService struct { // fingerprint must be provided in order to update the BackendService. Fingerprint string `json:"fingerprint,omitempty"` - // HealthChecks: The list of URLs to the HttpHealthCheck resource for - // health checking this BackendService. Currently at most one health - // check can be specified, and a health check is required. + // HealthChecks: The list of URLs to the HttpHealthCheck or + // HttpsHealthCheck resource for health checking this BackendService. + // Currently at most one health check can be specified, and a health + // check is required. HealthChecks []string `json:"healthChecks,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id uint64 `json:"id,omitempty,string"` - // Kind: Type of the resource. + // Kind: [Output Only] Type of resource. Always compute#backendService + // for backend services. Kind string `json:"kind,omitempty"` - // Name: Name of the resource; provided by the client when the resource + // Name: Name of the resource. Provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // Port: Deprecated in favor of port_name. The TCP port to connect on + // Port: Deprecated in favor of port name. The TCP port to connect on // the backend. The default value is 80. Port int64 `json:"port,omitempty"` @@ -794,42 +1417,101 @@ type BackendService struct { // Possible values: // "HTTP" + // "HTTPS" Protocol string `json:"protocol,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // TimeoutSec: How many seconds to wait for the backend before // considering it a failed request. Default is 30 seconds. TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Backends") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BackendService) MarshalJSON() ([]byte, error) { + type noMethod BackendService + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type BackendServiceGroupHealth struct { HealthStatus []*HealthStatus `json:"healthStatus,omitempty"` - // Kind: Type of resource. + // Kind: [Output Only] Type of resource. Always + // compute#backendServiceGroupHealth for the health of backend services. Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *BackendServiceGroupHealth) MarshalJSON() ([]byte, error) { + type noMethod BackendServiceGroupHealth + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// BackendServiceList: Contains a list of BackendService resources. type BackendServiceList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of BackendService resources. Items []*BackendService `json:"items,omitempty"` - // Kind: Type of resource. + // Kind: [Output Only] Type of resource. Always + // compute#backendServiceList for lists of backend services. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *BackendServiceList) MarshalJSON() ([]byte, error) { + type noMethod BackendServiceList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// DeprecationStatus: Deprecation status for a public resource. type DeprecationStatus struct { // Deleted: An optional RFC3339 timestamp on or after which the // deprecation state of this resource will be changed to DELETED. @@ -860,8 +1542,23 @@ type DeprecationStatus struct { // "DEPRECATED" // "OBSOLETE" State string `json:"state,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Deleted") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DeprecationStatus) MarshalJSON() ([]byte, error) { + type noMethod DeprecationStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Disk: A Disk resource. type Disk struct { // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. @@ -949,8 +1646,7 @@ type Disk struct { // provide this as a partial or full URL to the resource. For example, // the following are valid values: // - - // https://www.googleapis.com/compute/v1/projects/project/global/snapshot - // s/snapshot + // https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot // - projects/project/global/snapshots/snapshot // - global/snapshots/snapshot SourceSnapshot string `json:"sourceSnapshot,omitempty"` @@ -983,6 +1679,24 @@ type Disk struct { // Zone: [Output Only] URL of the zone where the disk resides. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Disk) MarshalJSON() ([]byte, error) { + type noMethod Disk + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DiskAggregatedList struct { @@ -1001,10 +1715,29 @@ type DiskAggregatedList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DiskAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod DiskAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskList: A list of Disk resources. type DiskList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -1021,8 +1754,26 @@ type DiskList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskList) MarshalJSON() ([]byte, error) { + type noMethod DiskList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DiskMoveRequest struct { @@ -1039,19 +1790,33 @@ type DiskMoveRequest struct { // partial URL. For example, the following are all valid URLs to a disk: // // - - // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk - // s/disk + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk // - projects/project/zones/zone/disks/disk // - zones/zone/disks/disk TargetDisk string `json:"targetDisk,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DestinationZone") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DiskMoveRequest) MarshalJSON() ([]byte, error) { + type noMethod DiskMoveRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskType: A disk type resource. type DiskType struct { // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` - // DefaultDiskSizeGb: [Output Only] Server defined default disk size in + // DefaultDiskSizeGb: [Output Only] Server-defined default disk size in // GB. DefaultDiskSizeGb int64 `json:"defaultDiskSizeGb,omitempty,string"` @@ -1074,7 +1839,7 @@ type DiskType struct { // Name: [Output Only] Name of the resource. Name string `json:"name,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // ValidDiskSize: [Output Only] An optional textual description of the @@ -1083,6 +1848,24 @@ type DiskType struct { // Zone: [Output Only] URL of the zone where the disk type resides. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskType) MarshalJSON() ([]byte, error) { + type noMethod DiskType + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DiskTypeAggregatedList struct { @@ -1101,10 +1884,29 @@ type DiskTypeAggregatedList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DiskTypeAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypeAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskTypeList: Contains a list of disk type resources. type DiskTypeList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -1121,8 +1923,26 @@ type DiskTypeList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypeList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypeList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DiskTypesScopedList struct { @@ -1132,8 +1952,24 @@ type DiskTypesScopedList struct { // Warning: [Output Only] Informational warning which replaces the list // of disk types when the list is empty. Warning *DiskTypesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DiskTypesScopedList) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// DiskTypesScopedListWarning: [Output Only] Informational warning which +// replaces the list of disk types when the list is empty. type DiskTypesScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -1160,6 +1996,20 @@ type DiskTypesScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DiskTypesScopedListWarningData struct { @@ -1168,6 +2018,20 @@ type DiskTypesScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DiskTypesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod DiskTypesScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DisksScopedList struct { @@ -1177,8 +2041,24 @@ type DisksScopedList struct { // Warning: [Output Only] Informational warning which replaces the list // of disks when the list is empty. Warning *DisksScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Disks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DisksScopedList) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// DisksScopedListWarning: [Output Only] Informational warning which +// replaces the list of disks when the list is empty. type DisksScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -1205,6 +2085,20 @@ type DisksScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *DisksScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type DisksScopedListWarningData struct { @@ -1213,15 +2107,30 @@ type DisksScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *DisksScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod DisksScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Firewall: A Firewall resource. type Firewall struct { // Allowed: The list of rules specified by this firewall. Each rule // specifies a protocol and port-range tuple that describes a permitted // connection. Allowed []*FirewallAllowed `json:"allowed,omitempty"` - // CreationTimestamp: [Output Only] Creation timestamp in RFC3339text + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` @@ -1255,13 +2164,12 @@ type Firewall struct { // as a full or partial URL. For example, the following are all valid // URLs: // - - // https://www.googleapis.com/compute/v1/projects/myproject/global/networ - // ks/my-network + // https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network // - projects/myproject/global/networks/my-network // - global/networks/default Network string `json:"network,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // SourceRanges: The IP address blocks that this rule applies to, @@ -1269,8 +2177,8 @@ type Firewall struct { // may be set. // // If both properties are set, an inbound connection is allowed if the - // range or the tag of the source matches the sourceRanges OR matches - // the sourceTags property; the connection does not need to match both + // range matches the sourceRanges OR the tag of the source matches the + // sourceTags property. The connection does not need to match both // properties. SourceRanges []string `json:"sourceRanges,omitempty"` @@ -1278,16 +2186,34 @@ type Firewall struct { // or both of sourceRanges and sourceTags may be set. // // If both properties are set, an inbound connection is allowed if the - // range or the tag of the source matches the sourceRanges OR matches - // the sourceTags property; the connection does not need to match both + // range matches the sourceRanges OR the tag of the source matches the + // sourceTags property. The connection does not need to match both // properties. SourceTags []string `json:"sourceTags,omitempty"` // TargetTags: A list of instance tags indicating sets of instances - // located on network which may make network connections as specified in - // allowed[]. If no targetTags are specified, the firewall rule applies - // to all instances on the specified network. + // located in the network that may make network connections as specified + // in allowed[]. If no targetTags are specified, the firewall rule + // applies to all instances on the specified network. TargetTags []string `json:"targetTags,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Allowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Firewall) MarshalJSON() ([]byte, error) { + type noMethod Firewall + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type FirewallAllowed struct { @@ -1304,8 +2230,23 @@ type FirewallAllowed struct { // // Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. Ports []string `json:"ports,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IPProtocol") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *FirewallAllowed) MarshalJSON() ([]byte, error) { + type noMethod FirewallAllowed + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// FirewallList: Contains a list of Firewall resources. type FirewallList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -1322,10 +2263,31 @@ type FirewallList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *FirewallList) MarshalJSON() ([]byte, error) { + type noMethod FirewallList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRule: A ForwardingRule resource. A ForwardingRule resource +// specifies which pool of target virtual machines to forward a packet +// to if it matches the given [IPAddress, IPProtocol, portRange] tuple. type ForwardingRule struct { // IPAddress: Value of the reserved IP address that this forwarding rule // is serving on behalf of. For global forwarding rules, the address @@ -1335,8 +2297,8 @@ type ForwardingRule struct { // regional) will be assigned. IPAddress string `json:"IPAddress,omitempty"` - // IPProtocol: The IP protocol to which this rule applies, valid options - // are 'TCP', 'UDP', 'ESP', 'AH' or 'SCTP'. + // IPProtocol: The IP protocol to which this rule applies. Valid options + // are TCP, UDP, ESP, AH or SCTP. // // Possible values: // "AH" @@ -1346,51 +2308,73 @@ type ForwardingRule struct { // "UDP" IPProtocol string `json:"IPProtocol,omitempty"` - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // Description: An optional textual description of the resource; // provided by the client when the resource is created. Description string `json:"description,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id uint64 `json:"id,omitempty,string"` - // Kind: Type of the resource. + // Kind: [Output Only] Type of the resource. Always + // compute#forwardingRule. Kind string `json:"kind,omitempty"` // Name: Name of the resource; provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // PortRange: Applicable only when 'IPProtocol' is 'TCP', 'UDP' or - // 'SCTP', only packets addressed to ports in the specified range will - // be forwarded to 'target'. If 'portRange' is left empty (default - // value), all ports are forwarded. Forwarding rules with the same - // [IPAddress, IPProtocol] pair must have disjoint port ranges. + // PortRange: Applicable only when IPProtocol is TCP, UDP, or SCTP, only + // packets addressed to ports in the specified range will be forwarded + // to target. Forwarding rules with the same [IPAddress, IPProtocol] + // pair must have disjoint port ranges. PortRange string `json:"portRange,omitempty"` - // Region: URL of the region where the regional forwarding rule resides - // (output only). This field is not applicable to global forwarding + // Region: [Output Only] URL of the region where the regional forwarding + // rule resides. This field is not applicable to global forwarding // rules. Region string `json:"region,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // Target: The URL of the target resource to receive the matched // traffic. For regional forwarding rules, this target must live in the // same region as the forwarding rule. For global forwarding rules, this - // target must be a global TargetHttpProxy resource. + // target must be a global TargetHttpProxy or TargetHttpsProxy resource. Target string `json:"target,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IPAddress") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRule) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRule + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type ForwardingRuleAggregatedList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id string `json:"id,omitempty"` // Items: A map of scoped forwarding rule lists. @@ -1399,17 +2383,36 @@ type ForwardingRuleAggregatedList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *ForwardingRuleAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRuleAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRuleList: Contains a list of ForwardingRule resources. type ForwardingRuleList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. Id string `json:"id,omitempty"` // Items: A list of ForwardingRule resources. @@ -1418,12 +2421,30 @@ type ForwardingRuleList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRuleList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRuleList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type ForwardingRulesScopedList struct { @@ -1433,8 +2454,24 @@ type ForwardingRulesScopedList struct { // Warning: Informational warning which replaces the list of forwarding // rules when the list is empty. Warning *ForwardingRulesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ForwardingRules") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *ForwardingRulesScopedList) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ForwardingRulesScopedListWarning: Informational warning which +// replaces the list of forwarding rules when the list is empty. type ForwardingRulesScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -1461,6 +2498,20 @@ type ForwardingRulesScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type ForwardingRulesScopedListWarningData struct { @@ -1469,10 +2520,38 @@ type ForwardingRulesScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ForwardingRulesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod ForwardingRulesScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type HealthCheckReference struct { HealthCheck string `json:"healthCheck,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthCheck") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HealthCheckReference) MarshalJSON() ([]byte, error) { + type noMethod HealthCheckReference + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type HealthStatus struct { @@ -1491,37 +2570,71 @@ type HealthStatus struct { // Port: The port on the instance. Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *HealthStatus) MarshalJSON() ([]byte, error) { + type noMethod HealthStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// HostRule: UrlMaps A host-matching rule for a URL. If matched, will +// use the named PathMatcher to select the BackendService. type HostRule struct { + // Description: An optional textual description. Description string `json:"description,omitempty"` // Hosts: The list of host patterns to match. They must be valid - // hostnames except that they may start with *. or *-. The * acts like a - // glob and will match any string of atoms (separated by .s and -s) to - // the left. + // hostnames, except * will match any string of ([a-z0-9-.]*). In that + // case, * must be the first character and must be followed in the + // pattern by either - or .. Hosts []string `json:"hosts,omitempty"` - // PathMatcher: The name of the PathMatcher to match the path portion of - // the URL, if the this HostRule matches the URL's host portion. + // PathMatcher: The name of the PathMatcher to use to match the path + // portion of the URL if the hostRule matches the URL's host portion. PathMatcher string `json:"pathMatcher,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *HostRule) MarshalJSON() ([]byte, error) { + type noMethod HostRule + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpHealthCheck: An HttpHealthCheck resource. This resource defines a +// template for how individual instances should be checked for health, +// via HTTP. type HttpHealthCheck struct { // CheckIntervalSec: How often (in seconds) to send a health check. The // default value is 5 seconds. CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // Description: An optional textual description of the resource; // provided by the client when the resource is created. Description string `json:"description,omitempty"` - // HealthyThreshold: A so-far unhealthy VM will be marked healthy after - // this many consecutive successes. The default value is 2. + // HealthyThreshold: A so-far unhealthy instance will be marked healthy + // after this many consecutive successes. The default value is 2. HealthyThreshold int64 `json:"healthyThreshold,omitempty"` // Host: The value of the host header in the HTTP health check request. @@ -1529,16 +2642,20 @@ type HttpHealthCheck struct { // health check is performed will be used. Host string `json:"host,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id uint64 `json:"id,omitempty,string"` // Kind: Type of the resource. Kind string `json:"kind,omitempty"` - // Name: Name of the resource; provided by the client when the resource + // Name: Name of the resource. Provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` // Port: The TCP port number for the HTTP health check request. The @@ -1549,7 +2666,7 @@ type HttpHealthCheck struct { // default value is "/". RequestPath string `json:"requestPath,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // TimeoutSec: How long (in seconds) to wait before claiming failure. @@ -1557,14 +2674,34 @@ type HttpHealthCheck struct { // greater value than checkIntervalSec. TimeoutSec int64 `json:"timeoutSec,omitempty"` - // UnhealthyThreshold: A so-far healthy VM will be marked unhealthy - // after this many consecutive failures. The default value is 2. + // UnhealthyThreshold: A so-far healthy instance will be marked + // unhealthy after this many consecutive failures. The default value is + // 2. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *HttpHealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HttpHealthCheck + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpHealthCheckList: Contains a list of HttpHealthCheck resources. type HttpHealthCheckList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of HttpHealthCheck resources. @@ -1573,14 +2710,152 @@ type HttpHealthCheckList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *HttpHealthCheckList) MarshalJSON() ([]byte, error) { + type noMethod HttpHealthCheckList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpsHealthCheck: An HttpsHealthCheck resource. This resource defines +// a template for how individual instances should be checked for health, +// via HTTPS. +type HttpsHealthCheck struct { + // CheckIntervalSec: How often (in seconds) to send a health check. The + // default value is 5 seconds. + CheckIntervalSec int64 `json:"checkIntervalSec,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource; + // provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // HealthyThreshold: A so-far unhealthy instance will be marked healthy + // after this many consecutive successes. The default value is 2. + HealthyThreshold int64 `json:"healthyThreshold,omitempty"` + + // Host: The value of the host header in the HTTPS health check request. + // If left empty (default value), the public IP on behalf of which this + // health check is performed will be used. + Host string `json:"host,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. Provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // Port: The TCP port number for the HTTPS health check request. The + // default value is 443. + Port int64 `json:"port,omitempty"` + + // RequestPath: The request path of the HTTPS health check request. The + // default value is "/". + RequestPath string `json:"requestPath,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // TimeoutSec: How long (in seconds) to wait before claiming failure. + // The default value is 5 seconds. It is invalid for timeoutSec to have + // a greater value than checkIntervalSec. + TimeoutSec int64 `json:"timeoutSec,omitempty"` + + // UnhealthyThreshold: A so-far healthy instance will be marked + // unhealthy after this many consecutive failures. The default value is + // 2. + UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "CheckIntervalSec") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpsHealthCheck) MarshalJSON() ([]byte, error) { + type noMethod HttpsHealthCheck + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// HttpsHealthCheckList: Contains a list of HttpsHealthCheck resources. +type HttpsHealthCheckList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of HttpsHealthCheck resources. + Items []*HttpsHealthCheck `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *HttpsHealthCheckList) MarshalJSON() ([]byte, error) { + type noMethod HttpsHealthCheckList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Image: An Image resource. type Image struct { // ArchiveSizeBytes: Size of the image tar.gz archive stored in Google // Cloud Storage (in bytes). @@ -1624,7 +2899,7 @@ type Image struct { // RawDisk: The parameters of the raw disk image. RawDisk *ImageRawDisk `json:"rawDisk,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // SourceDisk: URL of the The source disk used to create this image. @@ -1632,8 +2907,7 @@ type Image struct { // property or the rawDisk.source property but not both to create an // image. For example, the following are valid values: // - - // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk - // /disk + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/disk/disk // - projects/project/zones/zone/disk/disk // - zones/zone/disks/disk SourceDisk string `json:"sourceDisk,omitempty"` @@ -1660,8 +2934,27 @@ type Image struct { // "PENDING" // "READY" Status string `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ArchiveSizeBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *Image) MarshalJSON() ([]byte, error) { + type noMethod Image + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageRawDisk: The parameters of the raw disk image. type ImageRawDisk struct { // ContainerType: The format used to encode and transmit the block // device, which should be TAR. This is just a container and @@ -1680,27 +2973,61 @@ type ImageRawDisk struct { // stored. You must provide either this property or the sourceDisk // property but not both. Source string `json:"source,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContainerType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *ImageRawDisk) MarshalJSON() ([]byte, error) { + type noMethod ImageRawDisk + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ImageList: Contains a list of Image resources. type ImageList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id string `json:"id,omitempty"` - // Items: A list of Image resources. + // Items: [Output Only] A list of Image resources. Items []*Image `json:"items,omitempty"` // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *ImageList) MarshalJSON() ([]byte, error) { + type noMethod ImageList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Instance: An Instance resource. type Instance struct { // CanIpForward: Allows this instance to send and receive packets with // non-matching destination or source IPs. This is required if you plan @@ -1798,6 +3125,24 @@ type Instance struct { // Zone: [Output Only] URL of the zone where the instance resides. 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. "CanIpForward") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Instance) MarshalJSON() ([]byte, error) { + type noMethod Instance + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type InstanceAggregatedList struct { @@ -1819,8 +3164,848 @@ type InstanceAggregatedList struct { // SelfLink: [Output Only] Server defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *InstanceAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroup struct { + // CreationTimestamp: [Output Only] The creation timestamp for this + // instance group in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional text description for the instance group. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the named ports. The + // system uses this fingerprint to detect conflicts when multiple users + // change the named ports concurrently. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroup for instance groups. + Kind string `json:"kind,omitempty"` + + // Name: The name of the instance group. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // NamedPorts: 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: "http", port: 80},{name: "http", port: + // 8080}] + // + // Named ports apply to all instances in this instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // Network: [Output Only] The URL of the network to which all instances + // in the instance group belong. + Network string `json:"network,omitempty"` + + // SelfLink: [Output Only] The URL for this instance group. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // Size: [Output Only] The total number of instances in the instance + // group. + Size int64 `json:"size,omitempty"` + + // Zone: [Output Only] The URL of the zone where the instance group is + // located. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroup) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroup + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupAggregatedList struct { + // Id: [Output Only] A unique identifier for this aggregated list of + // instance groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: A map of scoped instance group lists. + Items map[string]InstanceGroupsScopedList `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupAggregatedList for aggregated lists of instance + // groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupList: A list of InstanceGroup resources. +type InstanceGroupList struct { + // Id: [Output Only] A unique identifier for this list of instance + // groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: A list of instance groups. + Items []*InstanceGroup `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupList for instance group lists. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManager: InstanceGroupManagers +// +// Next available tag: 20 +type InstanceGroupManager struct { + // BaseInstanceName: The base instance name to use for instances in this + // group. The value must be 1-58 characters long. Instances are named by + // appending a hyphen and a random four-character string to the base + // instance name. The base instance name must comply with RFC1035. + BaseInstanceName string `json:"baseInstanceName,omitempty"` + + // CreationTimestamp: [Output Only] The creation timestamp for this + // managed instance group in RFC3339 text format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // CurrentActions: [Output Only] The list of instance actions and the + // number of instances in this managed instance group that are scheduled + // for each of those actions. + CurrentActions *InstanceGroupManagerActionsSummary `json:"currentActions,omitempty"` + + // Description: An optional text description for the managed instance + // group. + Description string `json:"description,omitempty"` + + // Fingerprint: [Output Only] The fingerprint of the target pools + // information. You can use this optional field for optimistic locking + // when you update the target pool entries. + Fingerprint string `json:"fingerprint,omitempty"` + + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id uint64 `json:"id,omitempty,string"` + + // InstanceGroup: [Output Only] The URL of the Instance Group resource. + InstanceGroup string `json:"instanceGroup,omitempty"` + + // InstanceTemplate: The URL of the instance template that is specified + // for this managed instance group. The group uses this template to + // create all new instances in the managed instance group. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManager for managed instance groups. + Kind string `json:"kind,omitempty"` + + // Name: The name of the managed instance group. The name must be 1-63 + // characters long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] The URL for this managed instance group. The + // server defines this URL. + SelfLink string `json:"selfLink,omitempty"` + + // TargetPools: The URLs for all TargetPool resources to which instances + // in the instanceGroup field are added. The target pools automatically + // apply to all of the instances in the managed instance group. + TargetPools []string `json:"targetPools,omitempty"` + + // TargetSize: The target number of running instances for this managed + // instance group. Deleting or abandoning instances reduces this number. + // Resizing the group changes this number. + TargetSize int64 `json:"targetSize,omitempty"` + + // Zone: The name of the zone where the managed instance group is + // located. + 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. "BaseInstanceName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManager) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManager + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerActionsSummary struct { + // Abandoning: [Output Only] The total number of instances in the + // managed instance group that are scheduled to be abandoned. Abandoning + // an instance removes it from the managed instance group without + // deleting it. + Abandoning int64 `json:"abandoning,omitempty"` + + // Creating: [Output Only] The number of instances in the managed + // instance group that are scheduled to be created or are currently + // being created. + Creating int64 `json:"creating,omitempty"` + + // Deleting: [Output Only] The number of instances in the managed + // instance group that are scheduled to be deleted or are currently + // being deleted. + Deleting int64 `json:"deleting,omitempty"` + + // None: [Output Only] The number of instances in the managed instance + // group that are running and have no scheduled actions. + None int64 `json:"none,omitempty"` + + // Recreating: [Output Only] The number of instances in the managed + // instance group that are scheduled to be recreated or are currently + // being being recreated. Recreating an instance deletes the existing + // root persistent disk and creates a new disk from the image that is + // defined in the instance template. + Recreating int64 `json:"recreating,omitempty"` + + // Refreshing: [Output Only] The number of instances in the managed + // instance group that are being reconfigured with properties that do + // not require a restart or a recreate action. For example, setting or + // removing target pools for the instance. + Refreshing int64 `json:"refreshing,omitempty"` + + // Restarting: [Output Only] The number of instances in the managed + // instance group that are scheduled to be restarted or are currently + // being restarted. + Restarting int64 `json:"restarting,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Abandoning") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerActionsSummary) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerActionsSummary + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagerAggregatedList struct { + // Id: [Output Only] A unique identifier for this aggregated list of + // managed instance groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A map of filtered managed instance group lists. + Items map[string]InstanceGroupManagersScopedList `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerAggregatedList for an aggregated list of + // managed instance groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManagerList: [Output Only] A list of managed instance +// groups. +type InstanceGroupManagerList struct { + // Id: [Output Only] A unique identifier for this resource type. The + // server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of managed instance groups. + Items []*InstanceGroupManager `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupManagerList for a list of managed instance + // groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this resource type. The server + // generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagerList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagerList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersAbandonInstancesRequest struct { + // Instances: The URL for one or more instances to abandon from the + // managed instance group. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersAbandonInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersAbandonInstancesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersDeleteInstancesRequest struct { + // Instances: The list of instances to delete from this managed instance + // group. Specify one or more instance URLs. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersDeleteInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersDeleteInstancesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersListManagedInstancesResponse struct { + // ManagedInstances: [Output Only] The list of instances in the managed + // instance group. + ManagedInstances []*ManagedInstance `json:"managedInstances,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ManagedInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersListManagedInstancesResponse) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersListManagedInstancesResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersRecreateInstancesRequest struct { + // Instances: The URL for one or more instances to recreate. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersRecreateInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersRecreateInstancesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersScopedList struct { + // InstanceGroupManagers: [Output Only] The list of managed instance + // groups that are contained in the specified project and zone. + InstanceGroupManagers []*InstanceGroupManager `json:"instanceGroupManagers,omitempty"` + + // Warning: [Output Only] The warning that replaces the list of managed + // instance groups when the list is empty. + Warning *InstanceGroupManagersScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "InstanceGroupManagers") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupManagersScopedListWarning: [Output Only] The warning +// that replaces the list of managed instance groups when the list is +// empty. +type InstanceGroupManagersScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "DEPRECATED_RESOURCE_USED" + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" + // "INJECTED_KERNELS_DEPRECATED" + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" + // "NEXT_HOP_CANNOT_IP_FORWARD" + // "NEXT_HOP_INSTANCE_NOT_FOUND" + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" + // "NEXT_HOP_NOT_RUNNING" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstanceGroupManagersScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetInstanceTemplateRequest struct { + // InstanceTemplate: The URL of the instance template that is specified + // for this managed instance group. The group uses this template to + // create all new instances in the managed instance group. + InstanceTemplate string `json:"instanceTemplate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceTemplate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetInstanceTemplateRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetInstanceTemplateRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupManagersSetTargetPoolsRequest struct { + // Fingerprint: The fingerprint of the target pools information. Use + // this optional property to prevent conflicts when multiple users + // change the target pools settings concurrently. Obtain the fingerprint + // with the instanceGroupManagers.get method. Then, include the + // fingerprint in your request to ensure that you do not overwrite + // changes that were applied from another concurrent request. + Fingerprint string `json:"fingerprint,omitempty"` + + // TargetPools: The list of target pool URLs that instances in this + // managed instance group belong to. The managed instance group applies + // these target pools to all of the instances in the group. Existing + // instances and new instances in the group all receive these target + // pool settings. + TargetPools []string `json:"targetPools,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupManagersSetTargetPoolsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupManagersSetTargetPoolsRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsAddInstancesRequest struct { + // Instances: The list of instances to add to the instance group. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsAddInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsAddInstancesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsListInstances struct { + // Id: [Output Only] A unique identifier for this list of instance + // groups. The server generates this identifier. + Id string `json:"id,omitempty"` + + // Items: [Output Only] A list of instances and any named ports that are + // assigned to those instances. + Items []*InstanceWithNamedPorts `json:"items,omitempty"` + + // Kind: [Output Only] The resource type, which is always + // compute#instanceGroupsListInstances for lists of instance groups. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token that is used to continue a + // truncated list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] The URL for this list of instance groups. The + // server generates this URL. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsListInstances) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsListInstances + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsListInstancesRequest struct { + // InstanceState: A filter for the state of the instances in the + // instance group. Valid options are ALL or RUNNING. If you do not + // specify this parameter the list includes all instances regardless of + // their state. + // + // Possible values: + // "ALL" + // "RUNNING" + InstanceState string `json:"instanceState,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceState") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsListInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsListInstancesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsRemoveInstancesRequest struct { + // Instances: The list of instances to remove from the instance group. + Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsRemoveInstancesRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsRemoveInstancesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsScopedList struct { + // InstanceGroups: [Output Only] The list of instance groups that are + // contained in this scope. + InstanceGroups []*InstanceGroup `json:"instanceGroups,omitempty"` + + // Warning: [Output Only] An informational warning that replaces the + // list of instance groups when the list is empty. + Warning *InstanceGroupsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "InstanceGroups") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceGroupsScopedListWarning: [Output Only] An informational +// warning that replaces the list of instance groups when the list is +// empty. +type InstanceGroupsScopedListWarning struct { + // Code: [Output Only] The warning type identifier for this warning. + // + // Possible values: + // "DEPRECATED_RESOURCE_USED" + // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" + // "INJECTED_KERNELS_DEPRECATED" + // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" + // "NEXT_HOP_CANNOT_IP_FORWARD" + // "NEXT_HOP_INSTANCE_NOT_FOUND" + // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" + // "NEXT_HOP_NOT_RUNNING" + // "NOT_CRITICAL_ERROR" + // "NO_RESULTS_ON_PAGE" + // "REQUIRED_TOS_AGREEMENT" + // "RESOURCE_NOT_DELETED" + // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" + // "UNREACHABLE" + Code string `json:"code,omitempty"` + + // Data: [Output Only] Metadata for this warning in key: value format. + Data []*InstanceGroupsScopedListWarningData `json:"data,omitempty"` + + // Message: [Output Only] Optional human-readable details for this + // warning. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsScopedListWarningData struct { + // Key: [Output Only] A key for the warning data. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceGroupsSetNamedPortsRequest struct { + // Fingerprint: The fingerprint of the named ports information for this + // instance group. Use this optional property to prevent conflicts when + // multiple users change the named ports settings concurrently. Obtain + // the fingerprint with the instanceGroups.get method. Then, include the + // fingerprint in your request to ensure that you do not overwrite + // changes that were applied from another concurrent request. + Fingerprint string `json:"fingerprint,omitempty"` + + // NamedPorts: The list of named ports to set for this instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceGroupsSetNamedPortsRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceGroupsSetNamedPortsRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceList: Contains a list of instance resources. type InstanceList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -1839,6 +4024,24 @@ type InstanceList struct { // SelfLink: [Output Only] Server defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceList) MarshalJSON() ([]byte, error) { + type noMethod InstanceList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type InstanceMoveRequest struct { @@ -1855,19 +4058,34 @@ type InstanceMoveRequest struct { // full or partial URL. For example, the following are all valid URLs to // an instance: // - - // https://www.googleapis.com/compute/v1/projects/project/zones/zone/inst - // ances/instance + // https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance // - projects/project/zones/zone/instances/instance // - zones/zone/instances/instance TargetInstance string `json:"targetInstance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DestinationZone") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceMoveRequest) MarshalJSON() ([]byte, error) { + type noMethod InstanceMoveRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type InstanceProperties struct { - // CanIpForward: A boolean that specifies if instances created from this - // template can send packets with source IP addresses other than their - // own or receive packets with destination IP addresses other than their - // own. If you use these instances as an IP gateway or as the next-hop - // in a Route resource, specify true. Otherwise, specify false. + // CanIpForward: Enables instances created based on this template to + // send packets with source IP addresses other than their own and + // receive packets with destination IP addresses other than their own. + // If these instances will be used as an IP gateway or it will be set as + // the next-hop in a Route resource, specify true. If unsure, leave this + // set to false. See the canIpForward documentation for more + // information. CanIpForward bool `json:"canIpForward,omitempty"` // Description: An optional text description for the instances that are @@ -1889,16 +4107,11 @@ type InstanceProperties struct { Metadata *Metadata `json:"metadata,omitempty"` // NetworkInterfaces: An array of network access configurations for this - // interface. This specifies how this interface is configured to - // interact with other network services, such as connecting to the - // internet. Currently, ONE_TO_ONE_NAT is the only supported access - // configuration. If you do not specify any access configurations, the - // instances that are created from this template will have no external - // internet access. + // interface. NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"` - // Scheduling: A list of scheduling options for the instances that are - // created from this template. + // Scheduling: Specifies the scheduling options for the instances that + // are created from this template. Scheduling *Scheduling `json:"scheduling,omitempty"` // ServiceAccounts: A list of service accounts with specified scopes. @@ -1912,12 +4125,42 @@ type InstanceProperties struct { // firewalls. The setTags method can modify this list of tags. Each tag // within the list must comply with RFC1035. Tags *Tags `json:"tags,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CanIpForward") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceProperties) MarshalJSON() ([]byte, error) { + type noMethod InstanceProperties + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type InstanceReference struct { + // Instance: The URL for a specific instance. Instance string `json:"instance,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *InstanceReference) MarshalJSON() ([]byte, error) { + type noMethod InstanceReference + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceTemplate: An Instance Template resource. type InstanceTemplate struct { // CreationTimestamp: [Output Only] The creation timestamp for this // instance template in RFC3339 text format. @@ -1934,25 +4177,48 @@ type InstanceTemplate struct { // compute#instanceTemplate for instance templates. Kind string `json:"kind,omitempty"` - // Name: The name of the instance template. The name must be 1-63 - // characters long, and comply with RFC1035. + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // Properties: The instance properties for the instance template - // resource. + // Properties: The instance properties for this instance template. Properties *InstanceProperties `json:"properties,omitempty"` // SelfLink: [Output Only] The URL for this instance template. The // server defines this URL. SelfLink string `json:"selfLink,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *InstanceTemplate) MarshalJSON() ([]byte, error) { + type noMethod InstanceTemplate + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstanceTemplateList: A list of instance templates. type InstanceTemplateList struct { // Id: [Output Only] A unique identifier for this instance template. The // server defines this identifier. Id string `json:"id,omitempty"` - // Items: A list of InstanceTemplate resources. + // Items: [Output Only] list of InstanceTemplate resources. Items []*InstanceTemplate `json:"items,omitempty"` // Kind: [Output Only] The resource type, which is always @@ -1966,6 +4232,60 @@ type InstanceTemplateList struct { // SelfLink: [Output Only] The URL for this instance template list. The // server defines this URL. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceTemplateList) MarshalJSON() ([]byte, error) { + type noMethod InstanceTemplateList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type InstanceWithNamedPorts struct { + // Instance: [Output Only] The URL of the instance. + Instance string `json:"instance,omitempty"` + + // NamedPorts: [Output Only] The named ports that belong to this + // instance group. + NamedPorts []*NamedPort `json:"namedPorts,omitempty"` + + // Status: [Output Only] The status of the instance. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instance") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstanceWithNamedPorts) MarshalJSON() ([]byte, error) { + type noMethod InstanceWithNamedPorts + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type InstancesScopedList struct { @@ -1975,8 +4295,24 @@ type InstancesScopedList struct { // Warning: [Output Only] Informational warning which replaces the list // of instances when the list is empty. Warning *InstancesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *InstancesScopedList) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// InstancesScopedListWarning: [Output Only] Informational warning which +// replaces the list of instances when the list is empty. type InstancesScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -2003,6 +4339,20 @@ type InstancesScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *InstancesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type InstancesScopedListWarningData struct { @@ -2011,8 +4361,23 @@ type InstancesScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *InstancesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod InstancesScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// License: A license resource. type License struct { // ChargesUseFee: If true, the customer will be charged license fee for // running software that contains this license on an instance. @@ -2022,14 +4387,33 @@ type License struct { // licenses. Kind string `json:"kind,omitempty"` - // Name: Name of the resource. The name must be 1-63 characters long, - // and comply with RCF1035. + // Name: [Output Only] Name of the resource. The name is 1-63 characters + // long and complies with RFC1035. Name string `json:"name,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ChargesUseFee") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *License) MarshalJSON() ([]byte, error) { + type noMethod License + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineType: A Machine Type resource. type MachineType struct { // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. @@ -2076,17 +4460,49 @@ type MachineType struct { // to the instance. ScratchDisks []*MachineTypeScratchDisks `json:"scratchDisks,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // Zone: [Output Only] The name of the zone where the machine type // resides, such as us-central1-a. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineType) MarshalJSON() ([]byte, error) { + type noMethod MachineType + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type MachineTypeScratchDisks struct { // DiskGb: Size of the scratch disk, defined in GB. DiskGb int64 `json:"diskGb,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DiskGb") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeScratchDisks) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeScratchDisks + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type MachineTypeAggregatedList struct { @@ -2106,10 +4522,29 @@ type MachineTypeAggregatedList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *MachineTypeAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineTypeList: Contains a list of Machine Type resources. type MachineTypeList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -2126,8 +4561,26 @@ type MachineTypeList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypeList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypeList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type MachineTypesScopedList struct { @@ -2138,8 +4591,24 @@ type MachineTypesScopedList struct { // Warning: [Output Only] An informational warning that appears when the // machine types list is empty. Warning *MachineTypesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MachineTypes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *MachineTypesScopedList) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// MachineTypesScopedListWarning: [Output Only] An informational warning +// that appears when the machine types list is empty. type MachineTypesScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -2166,6 +4635,20 @@ type MachineTypesScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *MachineTypesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type MachineTypesScopedListWarningData struct { @@ -2174,8 +4657,162 @@ type MachineTypesScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *MachineTypesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod MachineTypesScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstance struct { + // CurrentAction: [Output Only] The current action that the managed + // instance group has scheduled for the instance. Possible values: + // - NONE The instance is running, and the managed instance group does + // not have any scheduled actions for this instance. + // - CREATING The managed instance group is creating this instance. + // - RECREATING The managed instance group is recreating this instance. + // + // - DELETING The managed instance group is permanently deleting this + // instance. + // - ABANDONING The managed instance group is abandoning this instance. + // The instance will be removed from the instance group and from any + // target pools that are associated with this group. + // - RESTARTING The managed instance group is restarting the instance. + // + // - REFRESHING The managed instance group is applying configuration + // changes to the instance without stopping it. For example, the group + // can update the target pool list for an instance without stopping that + // instance. + // + // Possible values: + // "ABANDONING" + // "CREATING" + // "DELETING" + // "NONE" + // "RECREATING" + // "REFRESHING" + // "RESTARTING" + CurrentAction string `json:"currentAction,omitempty"` + + // Id: [Output only] The unique identifier for this resource. This field + // is empty when instance does not exist. + Id uint64 `json:"id,omitempty,string"` + + // Instance: [Output Only] The URL of the instance. The URL can exist + // even if the instance has not yet been created. + Instance string `json:"instance,omitempty"` + + // InstanceStatus: [Output Only] The status of the instance. This field + // is empty when the instance does not exist. + // + // Possible values: + // "PROVISIONING" + // "RUNNING" + // "STAGING" + // "STOPPED" + // "STOPPING" + // "SUSPENDED" + // "SUSPENDING" + // "TERMINATED" + InstanceStatus string `json:"instanceStatus,omitempty"` + + // LastAttempt: [Output Only] Information about the last attempt to + // create or delete the instance. + LastAttempt *ManagedInstanceLastAttempt `json:"lastAttempt,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CurrentAction") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstance) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstance + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstanceLastAttempt struct { + // Errors: [Output Only] Encountered errors during the last attempt to + // create or delete the instance. + Errors *ManagedInstanceLastAttemptErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttempt) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttempt + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ManagedInstanceLastAttemptErrors: [Output Only] Encountered errors +// during the last attempt to create or delete the instance. +type ManagedInstanceLastAttemptErrors struct { + // Errors: [Output Only] The array of errors encountered while + // processing this operation. + Errors []*ManagedInstanceLastAttemptErrorsErrors `json:"errors,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Errors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttemptErrors) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttemptErrors + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type ManagedInstanceLastAttemptErrorsErrors struct { + // Code: [Output Only] The error type identifier for this error. + Code string `json:"code,omitempty"` + + // Location: [Output Only] Indicates the field in the request which + // caused the error. This property is optional. + Location string `json:"location,omitempty"` + + // Message: [Output Only] An optional, human-readable error message. + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ManagedInstanceLastAttemptErrorsErrors) MarshalJSON() ([]byte, error) { + type noMethod ManagedInstanceLastAttemptErrorsErrors + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Metadata: A metadata key/value entry. type Metadata struct { // Fingerprint: Specifies a fingerprint for this request, which is // essentially a hash of the metadata's contents and used for optimistic @@ -2192,6 +4829,20 @@ type Metadata struct { // Kind: [Output Only] Type of the resource. Always compute#metadata for // metadata. Kind string `json:"kind,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Metadata) MarshalJSON() ([]byte, error) { + type noMethod Metadata + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type MetadataItems struct { @@ -2206,9 +4857,48 @@ type MetadataItems struct { // only have meaning as interpreted by the image running in the // instance. The only restriction placed on values is that their size // must be less than or equal to 32768 bytes. - Value string `json:"value,omitempty"` + 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *MetadataItems) MarshalJSON() ([]byte, error) { + type noMethod MetadataItems + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// NamedPort: The named port. For example: . +type NamedPort struct { + // Name: The name for this named port. The name must be 1-63 characters + // long, and comply with RFC1035. + Name string `json:"name,omitempty"` + + // Port: The port number, which can be a value between 1 and 65535. + Port int64 `json:"port,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *NamedPort) MarshalJSON() ([]byte, error) { + type noMethod NamedPort + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Network: A network resource. type Network struct { // IPv4Range: The range of internal addresses that are legal on this // network. This range is a CIDR specification, for example: @@ -2219,8 +4909,8 @@ type Network struct { // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` - // Description: An optional textual description of the resource; - // provided by the client when the resource is created. + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. Description string `json:"description,omitempty"` // GatewayIPv4: A gateway address for default routing to other networks. @@ -2228,7 +4918,7 @@ type Network struct { // typically as the first usable address in the IPv4Range. GatewayIPv4 string `json:"gatewayIPv4,omitempty"` - // Id: [Output Only] Unique identifier for the resource; defined by the + // Id: [Output Only] Unique identifier for the resource. Defined by the // server. Id uint64 `json:"id,omitempty,string"` @@ -2236,7 +4926,7 @@ type Network struct { // networks. Kind string `json:"kind,omitempty"` - // Name: Name of the resource; provided by the client when the resource + // Name: Name of the resource. Provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with // RFC1035. Specifically, the name must be 1-63 characters long and // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means @@ -2245,15 +4935,35 @@ type Network struct { // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "IPv4Range") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *Network) MarshalJSON() ([]byte, error) { + type noMethod Network + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// NetworkInterface: A network interface resource attached to an +// instance. type NetworkInterface struct { // AccessConfigs: An array of configurations for this interface. - // Currently, /global/gateways/default-internet-gateway NextHopGateway string `json:"nextHopGateway,omitempty"` - // NextHopInstance: The URL to an instance that should handle matching - // packets. + // NextHopInstance: The fully-qualified URL to an instance that should + // handle matching packets. For + // example: + // https://www.googleapis.com/compute/v1/projects/project/zones/ + // zone/instances/ NextHopInstance string `json:"nextHopInstance,omitempty"` // NextHopIp: The network IP address of an instance that should handle @@ -2752,15 +5805,34 @@ type Route struct { // Default value is 1000. A valid range is between 0 and 65535. Priority int64 `json:"priority,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined fully-qualified URL for this + // resource. SelfLink string `json:"selfLink,omitempty"` // Tags: A list of instance tags to which this route applies. Tags []string `json:"tags,omitempty"` - // Warnings: If potential misconfigurations are detected for this route, - // this field will be populated with warning messages. + // Warnings: [Output Only] If potential misconfigurations are detected + // for this route, this field will be populated with warning messages. Warnings []*RouteWarnings `json:"warnings,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Route) MarshalJSON() ([]byte, error) { + type noMethod Route + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type RouteWarnings struct { @@ -2789,6 +5861,20 @@ type RouteWarnings struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *RouteWarnings) MarshalJSON() ([]byte, error) { + type noMethod RouteWarnings + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type RouteWarningsData struct { @@ -2797,11 +5883,26 @@ type RouteWarningsData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *RouteWarningsData) MarshalJSON() ([]byte, error) { + type noMethod RouteWarningsData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// RouteList: Contains a list of route resources. type RouteList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of Route resources. @@ -2810,33 +5911,70 @@ type RouteList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *RouteList) MarshalJSON() ([]byte, error) { + type noMethod RouteList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Scheduling: Sets the scheduling options for an Instance. type Scheduling struct { // AutomaticRestart: Specifies whether the instance should be // automatically restarted if it is terminated by Compute Engine (not - // terminated by a user). + // terminated by a user). You can only set the automatic restart option + // for standard instances. Preemptible instances cannot be automatically + // restarted. AutomaticRestart bool `json:"automaticRestart,omitempty"` // OnHostMaintenance: Defines the maintenance behavior for this - // instance. The default behavior is MIGRATE. For more information, see - // Setting maintenance behavior. + // instance. For standard instances, the default behavior is MIGRATE. + // For preemptible instances, the default and only possible behavior is + // TERMINATE. For more information, see Setting maintenance behavior. // // Possible values: // "MIGRATE" // "TERMINATE" OnHostMaintenance string `json:"onHostMaintenance,omitempty"` - // Preemptible: Whether the Instance is preemptible. + // Preemptible: Whether the instance is preemptible. Preemptible bool `json:"preemptible,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AutomaticRestart") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *Scheduling) MarshalJSON() ([]byte, error) { + type noMethod Scheduling + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// SerialPortOutput: An instance's serial console output. type SerialPortOutput struct { // Contents: [Output Only] The contents of the console output. Contents string `json:"contents,omitempty"` @@ -2847,8 +5985,27 @@ type SerialPortOutput struct { // SelfLink: [Output Only] Server defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Contents") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *SerialPortOutput) MarshalJSON() ([]byte, error) { + type noMethod SerialPortOutput + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ServiceAccount: A service account. type ServiceAccount struct { // Email: Email address of the service account. Email string `json:"email,omitempty"` @@ -2856,26 +6013,41 @@ type ServiceAccount struct { // Scopes: The list of scopes to be made available for this service // account. Scopes []string `json:"scopes,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Email") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *ServiceAccount) MarshalJSON() ([]byte, error) { + type noMethod ServiceAccount + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Snapshot: A persistent disk snapshot resource. type Snapshot struct { - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // Description: An optional textual description of the resource; // provided by the client when the resource is created. Description string `json:"description,omitempty"` - // DiskSizeGb: Size of the persistent disk snapshot, specified in GB - // (output only). + // DiskSizeGb: [Output Only] Size of the snapshot, specified in GB. DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id uint64 `json:"id,omitempty,string"` - // Kind: Type of the resource. + // Kind: [Output Only] Type of the resource. Always compute#snapshot for + // Snapshot resources. Kind string `json:"kind,omitempty"` // Licenses: Public visible licenses. @@ -2883,22 +6055,26 @@ type Snapshot struct { // Name: Name of the resource; provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // SourceDisk: The source disk used to create this snapshot. SourceDisk string `json:"sourceDisk,omitempty"` - // SourceDiskId: The 'id' value of the disk used to create this - // snapshot. This value may be used to determine whether the snapshot - // was taken from the current or a previous instance of a given disk - // name. + // SourceDiskId: [Output Only] The ID value of the disk used to create + // this snapshot. This value may be used to determine whether the + // snapshot was taken from the current or a previous instance of a given + // disk name. SourceDiskId string `json:"sourceDiskId,omitempty"` - // Status: The status of the persistent disk snapshot (output only). + // Status: [Output Only] The status of the snapshot. // // Possible values: // "CREATING" @@ -2908,24 +6084,43 @@ type Snapshot struct { // "UPLOADING" Status string `json:"status,omitempty"` - // StorageBytes: A size of the the storage used by the snapshot. As - // snapshots share storage this number is expected to change with - // snapshot creation/deletion. + // StorageBytes: [Output Only] A size of the the storage used by the + // snapshot. As snapshots share storage, this number is expected to + // change with snapshot creation/deletion. StorageBytes int64 `json:"storageBytes,omitempty,string"` - // StorageBytesStatus: An indicator whether storageBytes is in a stable - // state, or it is being adjusted as a result of shared storage - // reallocation. + // StorageBytesStatus: [Output Only] An indicator whether storageBytes + // is in a stable state or it is being adjusted as a result of shared + // storage reallocation. // // Possible values: // "UPDATING" // "UP_TO_DATE" StorageBytesStatus string `json:"storageBytesStatus,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *Snapshot) MarshalJSON() ([]byte, error) { + type noMethod Snapshot + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// SnapshotList: Contains a list of Snapshot resources. type SnapshotList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of Snapshot resources. @@ -2934,14 +6129,131 @@ type SnapshotList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *SnapshotList) MarshalJSON() ([]byte, error) { + type noMethod SnapshotList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertificate: An SslCertificate resource. This resource provides a +// mechanism to upload an SSL key and certificate to global HTTPS +// loadbalancer to serve secure connections. +type SslCertificate struct { + // Certificate: A local certificate file. The certificate must be in PEM + // format. The certificate chain must be no greater than 5 certs long. + // The chain must include at least one intermediate cert. + Certificate string `json:"certificate,omitempty"` + + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: [Output Only] Type of the resource. Always + // compute#sslCertificate for SSL certificates. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. Provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // PrivateKey: A write-only private key in PEM format. Only insert RPCs + // will include this field. + PrivateKey string `json:"privateKey,omitempty"` + + // SelfLink: [Output only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Certificate") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertificate) MarshalJSON() ([]byte, error) { + type noMethod SslCertificate + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// SslCertificateList: Contains a list of SslCertificate resources. +type SslCertificateList struct { + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of SslCertificate resources. + Items []*SslCertificate `json:"items,omitempty"` + + // Kind: Type of resource. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *SslCertificateList) MarshalJSON() ([]byte, error) { + type noMethod SslCertificateList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Tags: A set of instance tags. type Tags struct { // Fingerprint: Specifies a fingerprint for this request, which is // essentially a hash of the metadata's contents and used for optimistic @@ -2956,67 +6268,245 @@ type Tags struct { // Items: An array of tags. Each tag must be 1-63 characters long, and // comply with RFC1035. Items []string `json:"items,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Fingerprint") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *Tags) MarshalJSON() ([]byte, error) { + type noMethod Tags + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpProxy: A TargetHttpProxy resource. This resource defines an +// HTTP proxy. type TargetHttpProxy struct { - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // Description: An optional textual description of the resource; // provided by the client when the resource is created. Description string `json:"description,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id uint64 `json:"id,omitempty,string"` - // Kind: Type of the resource. + // Kind: [Output Only] Type of resource. Always compute#operation for + // Operation resources. Kind string `json:"kind,omitempty"` // Name: Name of the resource; provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // UrlMap: URL to the UrlMap resource that defines the mapping from URL // to the BackendService. UrlMap string `json:"urlMap,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetHttpProxy) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpProxy + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpProxyList: A list of TargetHttpProxy resources. type TargetHttpProxyList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of TargetHttpProxy resources. Items []*TargetHttpProxy `json:"items,omitempty"` + // Kind: Type of resource. Always compute#targetHttpProxyList for lists + // of Target HTTP proxies. + Kind string `json:"kind,omitempty"` + + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. + NextPageToken string `json:"nextPageToken,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for this resource. + SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpProxyList) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpProxyList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +type TargetHttpsProxiesSetSslCertificatesRequest struct { + // SslCertificates: New set of URLs to SslCertificate resources to + // associate with this TargetHttpProxy. Currently exactly one ssl + // certificate must be specified. + SslCertificates []string `json:"sslCertificates,omitempty"` + + // ForceSendFields is a list of field names (e.g. "SslCertificates") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxiesSetSslCertificatesRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxiesSetSslCertificatesRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpsProxy: A TargetHttpsProxy resource. This resource defines +// an HTTPS proxy. +type TargetHttpsProxy struct { + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. + CreationTimestamp string `json:"creationTimestamp,omitempty"` + + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. + Description string `json:"description,omitempty"` + + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id uint64 `json:"id,omitempty,string"` + + // Kind: Type of the resource. + Kind string `json:"kind,omitempty"` + + // Name: Name of the resource. Provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. + Name string `json:"name,omitempty"` + + // SelfLink: [Output Only] Server-defined URL for the resource. + SelfLink string `json:"selfLink,omitempty"` + + // SslCertificates: URLs to SslCertificate resources that are used to + // authenticate connections to Backends. Currently exactly one SSL + // certificate must be specified. + SslCertificates []string `json:"sslCertificates,omitempty"` + + // UrlMap: URL to the UrlMap resource that defines the mapping from URL + // to the BackendService. + UrlMap string `json:"urlMap,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetHttpsProxy) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxy + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetHttpsProxyList: Contains a list of TargetHttpsProxy resources. +type TargetHttpsProxyList struct { + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. + Id string `json:"id,omitempty"` + + // Items: A list of TargetHttpsProxy resources. + Items []*TargetHttpsProxy `json:"items,omitempty"` + // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetHttpsProxyList) MarshalJSON() ([]byte, error) { + type noMethod TargetHttpsProxyList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstance: A TargetInstance resource. This resource defines an +// endpoint instance that terminates traffic of certain protocols. type TargetInstance struct { - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // Description: An optional textual description of the resource; // provided by the client when the resource is created. Description string `json:"description,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id uint64 `json:"id,omitempty,string"` // Instance: The URL to the instance that terminates the relevant @@ -3026,29 +6516,51 @@ type TargetInstance struct { // Kind: Type of the resource. Kind string `json:"kind,omitempty"` - // Name: Name of the resource; provided by the client when the resource + // Name: Name of the resource. Provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // NatPolicy: NAT option controlling how IPs are NAT'ed to the VM. + // NatPolicy: NAT option controlling how IPs are NAT'ed to the instance. // Currently only NO_NAT (default value) is supported. // // Possible values: // "NO_NAT" NatPolicy string `json:"natPolicy,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` - // Zone: URL of the zone where the target instance resides (output - // only). + // Zone: [Output Only] URL of the zone where the target instance + // resides. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstance) MarshalJSON() ([]byte, error) { + type noMethod TargetInstance + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetInstanceAggregatedList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id string `json:"id,omitempty"` // Items: A map of scoped target instance lists. @@ -3057,17 +6569,36 @@ type TargetInstanceAggregatedList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetInstanceAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstanceAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstanceList: Contains a list of TargetInstance resources. type TargetInstanceList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of TargetInstance resources. @@ -3076,12 +6607,30 @@ type TargetInstanceList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstanceList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstanceList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetInstancesScopedList struct { @@ -3091,8 +6640,24 @@ type TargetInstancesScopedList struct { // Warning: Informational warning which replaces the list of addresses // when the list is empty. Warning *TargetInstancesScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TargetInstances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetInstancesScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetInstancesScopedListWarning: Informational warning which +// replaces the list of addresses when the list is empty. type TargetInstancesScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -3119,6 +6684,20 @@ type TargetInstancesScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetInstancesScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetInstancesScopedListWarningData struct { @@ -3127,28 +6706,45 @@ type TargetInstancesScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetInstancesScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetInstancesScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPool: A TargetPool resource. This resource defines a pool of +// instances, associated HttpHealthCheck resources, and the fallback +// TargetPool. type TargetPool struct { // BackupPool: This field is applicable only when the containing target // pool is serving a forwarding rule as the primary pool, and its - // 'failoverRatio' field is properly set to a value between [0, + // failoverRatio field is properly set to a value between [0, // 1]. // - // 'backupPool' and 'failoverRatio' together define the fallback - // behavior of the primary target pool: if the ratio of the healthy VMs - // in the primary pool is at or below 'failoverRatio', traffic arriving - // at the load-balanced IP will be directed to the backup pool. + // backupPool and failoverRatio together define the fallback behavior of + // the primary target pool: if the ratio of the healthy instances in the + // primary pool is at or below failoverRatio, traffic arriving at the + // load-balanced IP will be directed to the backup pool. // - // In case where 'failoverRatio' and 'backupPool' are not set, or all - // the VMs in the backup pool are unhealthy, the traffic will be + // In case where failoverRatio and backupPool are not set, or all the + // instances in the backup pool are unhealthy, the traffic will be // directed back to the primary pool in the "force" mode, where traffic - // will be spread to the healthy VMs with the best effort, or to all VMs - // when no VM is healthy. + // will be spread to the healthy instances with the best effort, or to + // all instances when no instance is healthy. BackupPool string `json:"backupPool,omitempty"` - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // Description: An optional textual description of the resource; @@ -3160,66 +6756,92 @@ type TargetPool struct { // not as a backup pool to some other target pool). The value of the // field must be in [0, 1]. // - // If set, 'backupPool' must also be set. They together define the + // If set, backupPool must also be set. They together define the // fallback behavior of the primary target pool: if the ratio of the - // healthy VMs in the primary pool is at or below this number, traffic - // arriving at the load-balanced IP will be directed to the backup - // pool. + // healthy instances in the primary pool is at or below this number, + // traffic arriving at the load-balanced IP will be directed to the + // backup pool. // - // In case where 'failoverRatio' is not set or all the VMs in the backup - // pool are unhealthy, the traffic will be directed back to the primary - // pool in the "force" mode, where traffic will be spread to the healthy - // VMs with the best effort, or to all VMs when no VM is healthy. + // In case where failoverRatio is not set or all the instances in the + // backup pool are unhealthy, the traffic will be directed back to the + // primary pool in the "force" mode, where traffic will be spread to the + // healthy instances with the best effort, or to all instances when no + // instance is healthy. FailoverRatio float64 `json:"failoverRatio,omitempty"` // HealthChecks: A list of URLs to the HttpHealthCheck resource. A - // member VM in this pool is considered healthy if and only if all - // specified health checks pass. An empty list means all member VMs will - // be considered healthy at all times. + // member instance in this pool is considered healthy if and only if all + // specified health checks pass. An empty list means all member + // instances will be considered healthy at all times. HealthChecks []string `json:"healthChecks,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource; defined by the + // server. Id uint64 `json:"id,omitempty,string"` - // Instances: A list of resource URLs to the member VMs serving this - // pool. They must live in zones contained in the same region as this - // pool. + // Instances: A list of resource URLs to the member virtual machines + // serving this pool. They must live in zones contained in the same + // region as this pool. Instances []string `json:"instances,omitempty"` // Kind: Type of the resource. Kind string `json:"kind,omitempty"` - // Name: Name of the resource; provided by the client when the resource + // Name: Name of the resource. Provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` - // Region: URL of the region where the target pool resides (output - // only). + // Region: [Output Only] URL of the region where the target pool + // resides. Region string `json:"region,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // SessionAffinity: Sesssion affinity option, must be one of the - // following values: 'NONE': Connections from the same client IP may go - // to any VM in the pool; 'CLIENT_IP': Connections from the same client - // IP will go to the same VM in the pool while that VM remains healthy. - // 'CLIENT_IP_PROTO': Connections from the same client IP with the same - // IP protocol will go to the same VM in the pool while that VM remains + // following values: + // NONE: Connections from the same client IP may go to any instance in + // the pool. + // CLIENT_IP: Connections from the same client IP will go to the same + // instance in the pool while that instance remains // healthy. + // CLIENT_IP_PROTO: Connections from the same client IP with the same IP + // protocol will go to the same instance in the pool while that instance + // remains healthy. // // Possible values: // "CLIENT_IP" // "CLIENT_IP_PROTO" // "NONE" SessionAffinity string `json:"sessionAffinity,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "BackupPool") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPool) MarshalJSON() ([]byte, error) { + type noMethod TargetPool + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolAggregatedList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id string `json:"id,omitempty"` // Items: A map of scoped target pool lists. @@ -3228,12 +6850,30 @@ type TargetPoolAggregatedList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolInstanceHealth struct { @@ -3241,11 +6881,30 @@ type TargetPoolInstanceHealth struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetPoolInstanceHealth) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolInstanceHealth + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPoolList: Contains a list of TargetPool resources. type TargetPoolList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Defined by the + // server. Id string `json:"id,omitempty"` // Items: A list of TargetPool resources. @@ -3254,32 +6913,106 @@ type TargetPoolList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolsAddHealthCheckRequest struct { // HealthChecks: Health check URLs to be added to targetPool. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthChecks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsAddHealthCheckRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsAddHealthCheckRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolsAddInstanceRequest struct { // Instances: URLs of the instances to be added to targetPool. Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsAddInstanceRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsAddInstanceRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolsRemoveHealthCheckRequest struct { // HealthChecks: Health check URLs to be removed from targetPool. HealthChecks []*HealthCheckReference `json:"healthChecks,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthChecks") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsRemoveHealthCheckRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsRemoveHealthCheckRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolsRemoveInstanceRequest struct { // Instances: URLs of the instances to be removed from targetPool. Instances []*InstanceReference `json:"instances,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Instances") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsRemoveInstanceRequest) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsRemoveInstanceRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolsScopedList struct { @@ -3289,8 +7022,24 @@ type TargetPoolsScopedList struct { // Warning: Informational warning which replaces the list of addresses // when the list is empty. Warning *TargetPoolsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TargetPools") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetPoolsScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetPoolsScopedListWarning: Informational warning which replaces +// the list of addresses when the list is empty. type TargetPoolsScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -3317,6 +7066,20 @@ type TargetPoolsScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetPoolsScopedListWarningData struct { @@ -3325,10 +7088,38 @@ type TargetPoolsScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetPoolsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetPoolsScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetReference struct { Target string `json:"target,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Target") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetReference) MarshalJSON() ([]byte, error) { + type noMethod TargetReference + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetVpnGateway struct { @@ -3353,9 +7144,13 @@ type TargetVpnGateway struct { // for target VPN gateways. Kind string `json:"kind,omitempty"` - // Name: Name of the resource. Provided by the client when the resource - // is created. The name must be 1-63 characters long and comply with - // RFC1035. + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` // Network: URL of the network to which this VPN gateway is attached. @@ -3382,6 +7177,24 @@ type TargetVpnGateway struct { // VpnTunnels are created using compute.vpntunnels.insert and associated // to a VPN gateway. Tunnels []string `json:"tunnels,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGateway) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGateway + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetVpnGatewayAggregatedList struct { @@ -3402,8 +7215,27 @@ type TargetVpnGatewayAggregatedList struct { // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetVpnGatewayAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewayAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetVpnGatewayList: Contains a list of TargetVpnGateway resources. type TargetVpnGatewayList struct { // Id: [Output Only] Unique identifier for the resource. Defined by the // server. @@ -3422,6 +7254,24 @@ type TargetVpnGatewayList struct { // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewayList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewayList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetVpnGatewaysScopedList struct { @@ -3432,8 +7282,24 @@ type TargetVpnGatewaysScopedList struct { // Warning: [Output Only] Informational warning which replaces the list // of addresses when the list is empty. Warning *TargetVpnGatewaysScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TargetVpnGateways") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TargetVpnGatewaysScopedList) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// TargetVpnGatewaysScopedListWarning: [Output Only] Informational +// warning which replaces the list of addresses when the list is empty. type TargetVpnGatewaysScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -3460,6 +7326,20 @@ type TargetVpnGatewaysScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TargetVpnGatewaysScopedListWarningData struct { @@ -3468,6 +7348,20 @@ type TargetVpnGatewaysScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *TargetVpnGatewaysScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod TargetVpnGatewaysScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type TestFailure struct { @@ -3478,19 +7372,36 @@ type TestFailure struct { Host string `json:"host,omitempty"` Path string `json:"path,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActualService") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *TestFailure) MarshalJSON() ([]byte, error) { + type noMethod TestFailure + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMap: A UrlMap resource. This resource defines the mapping from URL +// to the BackendService resource, based on the "longest-match" of the +// URL's host and path. type UrlMap struct { - // CreationTimestamp: Creation timestamp in RFC3339 text format (output - // only). + // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text + // format. CreationTimestamp string `json:"creationTimestamp,omitempty"` // DefaultService: The URL of the BackendService resource if none of the // hostRules match. DefaultService string `json:"defaultService,omitempty"` - // Description: An optional textual description of the resource; - // provided by the client when the resource is created. + // Description: An optional textual description of the resource. + // Provided by the client when the resource is created. Description string `json:"description,omitempty"` // Fingerprint: Fingerprint of this resource. A hash of the contents @@ -3502,32 +7413,55 @@ type UrlMap struct { // HostRules: The list of HostRules to use against the URL. HostRules []*HostRule `json:"hostRules,omitempty"` - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. Id uint64 `json:"id,omitempty,string"` // Kind: Type of the resource. Kind string `json:"kind,omitempty"` - // Name: Name of the resource; provided by the client when the resource + // Name: Name of the resource. Provided by the client when the resource // is created. The name must be 1-63 characters long, and comply with - // RFC1035. + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` // PathMatchers: The list of named PathMatchers to use against the URL. PathMatchers []*PathMatcher `json:"pathMatchers,omitempty"` - // SelfLink: Server defined URL for the resource (output only). + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // Tests: The list of expected URL mappings. Request to update this // UrlMap will succeed only all of the test cases pass. Tests []*UrlMapTest `json:"tests,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *UrlMap) MarshalJSON() ([]byte, error) { + type noMethod UrlMap + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapList: Contains a list of UrlMap resources. type UrlMapList struct { - // Id: Unique identifier for the resource; defined by the server (output - // only). + // Id: [Output Only] Unique identifier for the resource. Set by the + // server. Id string `json:"id,omitempty"` // Items: A list of UrlMap resources. @@ -3536,18 +7470,51 @@ type UrlMapList struct { // Kind: Type of resource. Kind string `json:"kind,omitempty"` - // NextPageToken: A token used to continue a truncated list request - // (output only). + // NextPageToken: [Output Only] A token used to continue a truncated + // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapList) MarshalJSON() ([]byte, error) { + type noMethod UrlMapList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type UrlMapReference struct { UrlMap string `json:"urlMap,omitempty"` + + // ForceSendFields is a list of field names (e.g. "UrlMap") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *UrlMapReference) MarshalJSON() ([]byte, error) { + type noMethod UrlMapReference + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapTest: Message for the expected URL mappings. type UrlMapTest struct { // Description: Description of this test case. Description string `json:"description,omitempty"` @@ -3561,8 +7528,24 @@ type UrlMapTest struct { // Service: Expected BackendService resource the given URL should be // mapped to. Service string `json:"service,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *UrlMapTest) MarshalJSON() ([]byte, error) { + type noMethod UrlMapTest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// UrlMapValidationResult: Message representing the validation result +// for a UrlMap. type UrlMapValidationResult struct { LoadErrors []string `json:"loadErrors,omitempty"` @@ -3576,17 +7559,66 @@ type UrlMapValidationResult struct { // test passed. If false, 'testFailures's indicate the reason of // failure. TestPassed bool `json:"testPassed,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LoadErrors") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapValidationResult) MarshalJSON() ([]byte, error) { + type noMethod UrlMapValidationResult + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type UrlMapsValidateRequest struct { // Resource: Content of the UrlMap to be validated. Resource *UrlMap `json:"resource,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Resource") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UrlMapsValidateRequest) MarshalJSON() ([]byte, error) { + type noMethod UrlMapsValidateRequest + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type UrlMapsValidateResponse struct { Result *UrlMapValidationResult `json:"result,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Result") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *UrlMapsValidateResponse) MarshalJSON() ([]byte, error) { + type noMethod UrlMapsValidateResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// UsageExportLocation: The location in Cloud Storage and naming method +// of the daily usage report. Contains bucket_name and report_name +// prefix. type UsageExportLocation struct { // BucketName: The name of an existing bucket in Cloud Storage where the // usage report object is stored. The Google Service Account is granted @@ -3601,6 +7633,20 @@ type UsageExportLocation struct { // usage according to Pacific Time. If you supply a prefix, it should // conform to Cloud Storage object naming conventions. ReportNamePrefix string `json:"reportNamePrefix,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BucketName") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *UsageExportLocation) MarshalJSON() ([]byte, error) { + type noMethod UsageExportLocation + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type VpnTunnel struct { @@ -3620,11 +7666,6 @@ type VpnTunnel struct { // server. Id uint64 `json:"id,omitempty,string"` - // IkeNetworks: IKE networks to use when establishing the VPN tunnel - // with peer VPN gateway. The value should be a CIDR formatted string, - // for example: 192.168.0.0/16. The ranges should be disjoint. - IkeNetworks []string `json:"ikeNetworks,omitempty"` - // IkeVersion: IKE protocol version to use when establishing the VPN // tunnel with peer VPN gateway. Acceptable IKE versions are 1 or 2. // Default version is 2. @@ -3634,9 +7675,13 @@ type VpnTunnel struct { // VPN tunnels. Kind string `json:"kind,omitempty"` - // Name: Name of the resource. Provided by the client when the resource - // is created. The name must be 1-63 characters long and comply with - // RFC1035. + // Name: Name of the resource; provided by the client when the resource + // is created. The name must be 1-63 characters long, and comply with + // RFC1035. Specifically, the name must be 1-63 characters long and + // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means + // the first character must be a lowercase letter, and all following + // characters must be a dash, lowercase letter, or digit, except the + // last character, which cannot be a dash. Name string `json:"name,omitempty"` // PeerIp: IP address of the peer VPN gateway. @@ -3645,7 +7690,7 @@ type VpnTunnel struct { // Region: [Output Only] URL of the region where the VPN tunnel resides. Region string `json:"region,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // SharedSecret: Shared secret used to set the secure session between @@ -3674,6 +7719,24 @@ type VpnTunnel struct { // TargetVpnGateway: URL of the VPN gateway to which this VPN tunnel is // associated. Provided by the client when the VPN tunnel is created. TargetVpnGateway string `json:"targetVpnGateway,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnel) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnel + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type VpnTunnelAggregatedList struct { @@ -3692,10 +7755,29 @@ type VpnTunnelAggregatedList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: [Output Only] Server defined URL for this resource. + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *VpnTunnelAggregatedList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelAggregatedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// VpnTunnelList: Contains a list of VpnTunnel resources. type VpnTunnelList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -3714,6 +7796,24 @@ type VpnTunnelList struct { // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type VpnTunnelsScopedList struct { @@ -3723,8 +7823,24 @@ type VpnTunnelsScopedList struct { // Warning: Informational warning which replaces the list of addresses // when the list is empty. Warning *VpnTunnelsScopedListWarning `json:"warning,omitempty"` + + // ForceSendFields is a list of field names (e.g. "VpnTunnels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *VpnTunnelsScopedList) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// VpnTunnelsScopedListWarning: Informational warning which replaces the +// list of addresses when the list is empty. type VpnTunnelsScopedListWarning struct { // Code: [Output Only] The warning type identifier for this warning. // @@ -3751,6 +7867,20 @@ type VpnTunnelsScopedListWarning struct { // Message: [Output Only] Optional human-readable details for this // warning. 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *VpnTunnelsScopedListWarning) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedListWarning + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type VpnTunnelsScopedListWarningData struct { @@ -3759,8 +7889,23 @@ type VpnTunnelsScopedListWarningData struct { // 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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *VpnTunnelsScopedListWarningData) MarshalJSON() ([]byte, error) { + type noMethod VpnTunnelsScopedListWarningData + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// Zone: A Zone resource. type Zone struct { // CreationTimestamp: [Output Only] Creation timestamp in RFC3339 text // format. @@ -3793,7 +7938,7 @@ type Zone struct { // the zone. Region string `json:"region,omitempty"` - // SelfLink: [Output Only] Server defined URL for the resource. + // SelfLink: [Output Only] Server-defined URL for the resource. SelfLink string `json:"selfLink,omitempty"` // Status: [Output Only] Status of the zone, either UP or DOWN. @@ -3802,6 +7947,24 @@ type Zone struct { // "DOWN" // "UP" Status string `json:"status,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 values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *Zone) MarshalJSON() ([]byte, error) { + type noMethod Zone + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } type ZoneMaintenanceWindows struct { @@ -3819,8 +7982,23 @@ type ZoneMaintenanceWindows struct { // Name: [Output Only] Name of the maintenance window. Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BeginTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` } +func (s *ZoneMaintenanceWindows) MarshalJSON() ([]byte, error) { + type noMethod ZoneMaintenanceWindows + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + +// ZoneList: Contains a list of zone resources. type ZoneList struct { // Id: [Output Only] Unique identifier for the resource; defined by the // server. @@ -3836,80 +8014,145 @@ type ZoneList struct { // list request. NextPageToken string `json:"nextPageToken,omitempty"` - // SelfLink: Server defined URL for this resource (output only). + // SelfLink: [Output Only] Server-defined URL for this resource. SelfLink string `json:"selfLink,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *ZoneList) MarshalJSON() ([]byte, error) { + type noMethod ZoneList + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) } // method id "compute.addresses.aggregatedList": type AddressesAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of addresses grouped by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/aggregatedList func (r *AddressesService) AggregatedList(project string) *AddressesAggregatedListCall { - c := &AddressesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &AddressesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *AddressesAggregatedListCall) Filter(filter string) *AddressesAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *AddressesAggregatedListCall) MaxResults(maxResults int64) *AddressesAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *AddressesAggregatedListCall) PageToken(pageToken string) *AddressesAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *AddressesAggregatedListCall) Fields(s ...googleapi.Field) *AddressesAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesAggregatedListCall) IfNoneMatch(entityTag string) *AddressesAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AddressesAggregatedListCall) Context(ctx context.Context) *AddressesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/addresses") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.aggregatedList" call. +// Exactly one of *AddressAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *AddressAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -3917,7 +8160,12 @@ func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *AddressAggregatedList + ret := &AddressAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -3931,7 +8179,7 @@ func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -3945,7 +8193,7 @@ func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -3973,40 +8221,45 @@ func (c *AddressesAggregatedListCall) Do() (*AddressAggregatedList, error) { // method id "compute.addresses.delete": type AddressesDeleteCall struct { - s *Service - project string - region string - address string - opt_ map[string]interface{} + s *Service + project string + region string + address string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified address resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/delete func (r *AddressesService) Delete(project string, region string, address string) *AddressesDeleteCall { - c := &AddressesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &AddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.address = address return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *AddressesDeleteCall) Fields(s ...googleapi.Field) *AddressesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *AddressesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AddressesDeleteCall) Context(ctx context.Context) *AddressesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -4014,7 +8267,30 @@ func (c *AddressesDeleteCall) Do() (*Operation, error) { "address": c.address, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *AddressesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4022,7 +8298,12 @@ func (c *AddressesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4074,40 +8355,56 @@ func (c *AddressesDeleteCall) Do() (*Operation, error) { // method id "compute.addresses.get": type AddressesGetCall struct { - s *Service - project string - region string - address string - opt_ map[string]interface{} + s *Service + project string + region string + address string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified address resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/get func (r *AddressesService) Get(project string, region string, address string) *AddressesGetCall { - c := &AddressesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &AddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.address = address return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *AddressesGetCall) Fields(s ...googleapi.Field) *AddressesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *AddressesGetCall) Do() (*Address, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesGetCall) IfNoneMatch(entityTag string) *AddressesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AddressesGetCall) Context(ctx context.Context) *AddressesGetCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses/{address}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -4115,7 +8412,33 @@ func (c *AddressesGetCall) Do() (*Address, error) { "address": c.address, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.get" call. +// Exactly one of *Address or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Address.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *AddressesGetCall) Do() (*Address, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4123,7 +8446,12 @@ func (c *AddressesGetCall) Do() (*Address, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Address + ret := &Address{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4176,46 +8504,51 @@ func (c *AddressesGetCall) Do() (*Address, error) { // method id "compute.addresses.insert": type AddressesInsertCall struct { - s *Service - project string - region string - address *Address - opt_ map[string]interface{} + s *Service + project string + region string + address *Address + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates an address resource in the specified project using // the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/insert func (r *AddressesService) Insert(project string, region string, address *Address) *AddressesInsertCall { - c := &AddressesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &AddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.address = address return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *AddressesInsertCall) Fields(s ...googleapi.Field) *AddressesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *AddressesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AddressesInsertCall) Context(ctx context.Context) *AddressesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -4223,7 +8556,30 @@ func (c *AddressesInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *AddressesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4231,7 +8587,12 @@ func (c *AddressesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4278,77 +8639,124 @@ func (c *AddressesInsertCall) Do() (*Operation, error) { // method id "compute.addresses.list": type AddressesListCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of address resources contained within the // specified region. // For details, see https://cloud.google.com/compute/docs/reference/latest/addresses/list func (r *AddressesService) List(project string, region string) *AddressesListCall { - c := &AddressesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &AddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *AddressesListCall) Filter(filter string) *AddressesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *AddressesListCall) MaxResults(maxResults int64) *AddressesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *AddressesListCall) PageToken(pageToken string) *AddressesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *AddressesListCall) Fields(s ...googleapi.Field) *AddressesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *AddressesListCall) Do() (*AddressList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AddressesListCall) IfNoneMatch(entityTag string) *AddressesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AddressesListCall) Context(ctx context.Context) *AddressesListCall { + c.ctx_ = ctx + return c +} + +func (c *AddressesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/addresses") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.addresses.list" call. +// Exactly one of *AddressList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AddressList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *AddressesListCall) Do() (*AddressList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4356,7 +8764,12 @@ func (c *AddressesListCall) Do() (*AddressList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *AddressList + ret := &AddressList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4371,7 +8784,7 @@ func (c *AddressesListCall) Do() (*AddressList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -4385,7 +8798,7 @@ func (c *AddressesListCall) Do() (*AddressList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -4417,48 +8830,122 @@ func (c *AddressesListCall) Do() (*AddressList, error) { } -// method id "compute.backendServices.delete": +// method id "compute.autoscalers.aggregatedList": -type BackendServicesDeleteCall struct { - s *Service - project string - backendService string - opt_ map[string]interface{} +type AutoscalersAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// Delete: Deletes the specified BackendService resource. -// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete -func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall { - c := &BackendServicesDeleteCall{s: r.s, opt_: make(map[string]interface{})} +// AggregatedList: Retrieves the list of autoscalers grouped by scope. +func (r *AutoscalersService) AggregatedList(project string) *AutoscalersAggregatedListCall { + c := &AutoscalersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.backendService = backendService return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *AutoscalersAggregatedListCall) Filter(filter string) *AutoscalersAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *AutoscalersAggregatedListCall) MaxResults(maxResults int64) *AutoscalersAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AutoscalersAggregatedListCall) PageToken(pageToken string) *AutoscalersAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) +func (c *AutoscalersAggregatedListCall) Fields(s ...googleapi.Field) *AutoscalersAggregatedListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesDeleteCall) Do() (*Operation, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersAggregatedListCall) IfNoneMatch(entityTag string) *AutoscalersAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersAggregatedListCall) Context(ctx context.Context) *AutoscalersAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") - urls += "?" + params.Encode() - req, _ := http.NewRequest("DELETE", urls, body) + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/autoscalers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "backendService": c.backendService, + "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.aggregatedList" call. +// Exactly one of *AutoscalerAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *AutoscalerAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersAggregatedListCall) Do() (*AutoscalerAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4466,7 +8953,1046 @@ func (c *BackendServicesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &AutoscalerAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of autoscalers grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/autoscalers", + // "response": { + // "$ref": "AutoscalerAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.delete": + +type AutoscalersDeleteCall struct { + s *Service + project string + zone string + autoscaler string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified autoscaler resource. +func (r *AutoscalersService) Delete(project string, zone string, autoscaler string) *AutoscalersDeleteCall { + c := &AutoscalersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *AutoscalersDeleteCall) Fields(s ...googleapi.Field) *AutoscalersDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersDeleteCall) Context(ctx context.Context) *AutoscalersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *AutoscalersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified autoscaler resource.", + // "httpMethod": "DELETE", + // "id": "compute.autoscalers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the persistent autoscaler resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.get": + +type AutoscalersGetCall struct { + s *Service + project string + zone string + autoscaler string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// Get: Returns the specified autoscaler resource. +func (r *AutoscalersService) Get(project string, zone string, autoscaler string) *AutoscalersGetCall { + c := &AutoscalersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *AutoscalersGetCall) Fields(s ...googleapi.Field) *AutoscalersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersGetCall) IfNoneMatch(entityTag string) *AutoscalersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersGetCall) Context(ctx context.Context) *AutoscalersGetCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers/{autoscaler}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "autoscaler": c.autoscaler, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.get" call. +// Exactly one of *Autoscaler or error will be non-nil. 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 *AutoscalersGetCall) Do() (*Autoscaler, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Autoscaler{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified autoscaler resource.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the persistent autoscaler resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/autoscalers/{autoscaler}", + // "response": { + // "$ref": "Autoscaler" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.insert": + +type AutoscalersInsertCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Insert: Creates an autoscaler resource in the specified project using +// the data included in the request. +func (r *AutoscalersService) Insert(project string, zone string, autoscaler *Autoscaler) *AutoscalersInsertCall { + c := &AutoscalersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *AutoscalersInsertCall) Fields(s ...googleapi.Field) *AutoscalersInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersInsertCall) Context(ctx context.Context) *AutoscalersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *AutoscalersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an autoscaler resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.autoscalers.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.list": + +type AutoscalersListCall struct { + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// List: Retrieves the list of autoscaler resources contained within the +// specified zone. +func (r *AutoscalersService) List(project string, zone string) *AutoscalersListCall { + c := &AutoscalersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *AutoscalersListCall) Filter(filter string) *AutoscalersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *AutoscalersListCall) MaxResults(maxResults int64) *AutoscalersListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *AutoscalersListCall) PageToken(pageToken string) *AutoscalersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersListCall) Fields(s ...googleapi.Field) *AutoscalersListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *AutoscalersListCall) IfNoneMatch(entityTag string) *AutoscalersListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersListCall) Context(ctx context.Context) *AutoscalersListCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.list" call. +// Exactly one of *AutoscalerList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AutoscalerList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *AutoscalersListCall) Do() (*AutoscalerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &AutoscalerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of autoscaler resources contained within the specified zone.", + // "httpMethod": "GET", + // "id": "compute.autoscalers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/autoscalers", + // "response": { + // "$ref": "AutoscalerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.autoscalers.patch": + +type AutoscalersPatchCall struct { + s *Service + project string + zone string + autoscaler2 *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Patch: Updates an autoscaler resource in the specified project using +// the data included in the request. This method supports patch +// semantics. +func (r *AutoscalersService) Patch(project string, zone string, autoscaler string, autoscaler2 *Autoscaler) *AutoscalersPatchCall { + c := &AutoscalersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.urlParams_.Set("autoscaler", autoscaler) + c.autoscaler2 = autoscaler2 + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersPatchCall) Fields(s ...googleapi.Field) *AutoscalersPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersPatchCall) Context(ctx context.Context) *AutoscalersPatchCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler2) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.patch" call. +// Exactly one of *Operation or error will be non-nil. 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 *AutoscalersPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an autoscaler resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.autoscalers.patch", + // "parameterOrder": [ + // "project", + // "zone", + // "autoscaler" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the autoscaler resource to update.", + // "location": "query", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.autoscalers.update": + +type AutoscalersUpdateCall struct { + s *Service + project string + zone string + autoscaler *Autoscaler + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Update: Updates an autoscaler resource in the specified project using +// the data included in the request. +func (r *AutoscalersService) Update(project string, zone string, autoscaler *Autoscaler) *AutoscalersUpdateCall { + c := &AutoscalersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.autoscaler = autoscaler + return c +} + +// Autoscaler sets the optional parameter "autoscaler": Name of the +// autoscaler resource to update. +func (c *AutoscalersUpdateCall) Autoscaler(autoscaler string) *AutoscalersUpdateCall { + c.urlParams_.Set("autoscaler", autoscaler) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *AutoscalersUpdateCall) Fields(s ...googleapi.Field) *AutoscalersUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *AutoscalersUpdateCall) Context(ctx context.Context) *AutoscalersUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *AutoscalersUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscaler) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/autoscalers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.autoscalers.update" call. +// Exactly one of *Operation or error will be non-nil. 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 *AutoscalersUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates an autoscaler resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.autoscalers.update", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "autoscaler": { + // "description": "Name of the autoscaler resource to update.", + // "location": "query", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "Name of the zone scoping this request.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/autoscalers", + // "request": { + // "$ref": "Autoscaler" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.backendServices.delete": + +type BackendServicesDeleteCall struct { + s *Service + project string + backendService string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified BackendService resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/delete +func (r *BackendServicesService) Delete(project string, backendService string) *BackendServicesDeleteCall { + c := &BackendServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.backendService = backendService + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *BackendServicesDeleteCall) Fields(s ...googleapi.Field) *BackendServicesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesDeleteCall) Context(ctx context.Context) *BackendServicesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "backendService": c.backendService, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *BackendServicesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4513,42 +10039,84 @@ type BackendServicesGetCall struct { s *Service project string backendService string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified BackendService resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/get func (r *BackendServicesService) Get(project string, backendService string) *BackendServicesGetCall { - c := &BackendServicesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &BackendServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.backendService = backendService return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *BackendServicesGetCall) Fields(s ...googleapi.Field) *BackendServicesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesGetCall) Do() (*BackendService, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackendServicesGetCall) IfNoneMatch(entityTag string) *BackendServicesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesGetCall) Context(ctx context.Context) *BackendServicesGetCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "backendService": c.backendService, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.get" call. +// Exactly one of *BackendService or error will be non-nil. 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 whether the returned error was +// because http.StatusNotModified was returned. +func (c *BackendServicesGetCall) Do() (*BackendService, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4556,7 +10124,12 @@ func (c *BackendServicesGetCall) Do() (*BackendService, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *BackendService + ret := &BackendService{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4605,42 +10178,47 @@ type BackendServicesGetHealthCall struct { project string backendService string resourcegroupreference *ResourceGroupReference - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // GetHealth: Gets the most recent health check results for this // BackendService. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/getHealth func (r *BackendServicesService) GetHealth(project string, backendService string, resourcegroupreference *ResourceGroupReference) *BackendServicesGetHealthCall { - c := &BackendServicesGetHealthCall{s: r.s, opt_: make(map[string]interface{})} + c := &BackendServicesGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project 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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *BackendServicesGetHealthCall) Fields(s ...googleapi.Field) *BackendServicesGetHealthCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesGetHealthCall) Context(ctx context.Context) *BackendServicesGetHealthCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesGetHealthCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourcegroupreference) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}/getHealth") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -4648,7 +10226,30 @@ func (c *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.getHealth" call. +// Exactly one of *BackendServiceGroupHealth or error will be non-nil. +// 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 *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4656,7 +10257,12 @@ func (c *BackendServicesGetHealthCall) Do() (*BackendServiceGroupHealth, error) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *BackendServiceGroupHealth + ret := &BackendServiceGroupHealth{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4706,48 +10312,76 @@ type BackendServicesInsertCall struct { s *Service project string backendservice *BackendService - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a BackendService resource in the specified project // using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/insert func (r *BackendServicesService) Insert(project string, backendservice *BackendService) *BackendServicesInsertCall { - c := &BackendServicesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &BackendServicesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.backendservice = backendservice return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *BackendServicesInsertCall) Fields(s ...googleapi.Field) *BackendServicesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesInsertCall) Context(ctx context.Context) *BackendServicesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *BackendServicesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4755,7 +10389,12 @@ func (c *BackendServicesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4794,74 +10433,121 @@ func (c *BackendServicesInsertCall) Do() (*Operation, error) { // method id "compute.backendServices.list": type BackendServicesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of BackendService resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/list func (r *BackendServicesService) List(project string) *BackendServicesListCall { - c := &BackendServicesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &BackendServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *BackendServicesListCall) Filter(filter string) *BackendServicesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *BackendServicesListCall) MaxResults(maxResults int64) *BackendServicesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *BackendServicesListCall) PageToken(pageToken string) *BackendServicesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *BackendServicesListCall) Fields(s ...googleapi.Field) *BackendServicesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *BackendServicesListCall) IfNoneMatch(entityTag string) *BackendServicesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesListCall) Context(ctx context.Context) *BackendServicesListCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.list" call. +// Exactly one of *BackendServiceList or error will be non-nil. 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 *BackendServicesListCall) Do() (*BackendServiceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4869,7 +10555,12 @@ func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *BackendServiceList + ret := &BackendServiceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -4883,7 +10574,7 @@ func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -4897,7 +10588,7 @@ func (c *BackendServicesListCall) Do() (*BackendServiceList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -4929,42 +10620,47 @@ type BackendServicesPatchCall struct { project string backendService string backendservice *BackendService - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Patch: Update the entire content of the BackendService resource. This // method supports patch semantics. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/patch func (r *BackendServicesService) Patch(project string, backendService string, backendservice *BackendService) *BackendServicesPatchCall { - c := &BackendServicesPatchCall{s: r.s, opt_: make(map[string]interface{})} + c := &BackendServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.backendService = backendService c.backendservice = backendservice return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *BackendServicesPatchCall) Fields(s ...googleapi.Field) *BackendServicesPatchCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesPatchCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesPatchCall) Context(ctx context.Context) *BackendServicesPatchCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesPatchCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PATCH", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -4972,7 +10668,30 @@ func (c *BackendServicesPatchCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.patch" call. +// Exactly one of *Operation or error will be non-nil. 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 *BackendServicesPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -4980,7 +10699,12 @@ func (c *BackendServicesPatchCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5031,41 +10755,46 @@ type BackendServicesUpdateCall struct { project string backendService string backendservice *BackendService - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Update: Update the entire content of the BackendService resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/backendServices/update func (r *BackendServicesService) Update(project string, backendService string, backendservice *BackendService) *BackendServicesUpdateCall { - c := &BackendServicesUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c := &BackendServicesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.backendService = backendService c.backendservice = backendservice return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *BackendServicesUpdateCall) Fields(s ...googleapi.Field) *BackendServicesUpdateCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *BackendServicesUpdateCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *BackendServicesUpdateCall) Context(ctx context.Context) *BackendServicesUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *BackendServicesUpdateCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.backendservice) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/backendServices/{backendService}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PUT", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -5073,7 +10802,30 @@ func (c *BackendServicesUpdateCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.backendServices.update" call. +// Exactly one of *Operation or error will be non-nil. 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 *BackendServicesUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5081,7 +10833,12 @@ func (c *BackendServicesUpdateCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5128,74 +10885,121 @@ func (c *BackendServicesUpdateCall) Do() (*Operation, error) { // method id "compute.diskTypes.aggregatedList": type DiskTypesAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of disk type resources grouped by // scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/aggregatedList func (r *DiskTypesService) AggregatedList(project string) *DiskTypesAggregatedListCall { - c := &DiskTypesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &DiskTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *DiskTypesAggregatedListCall) Filter(filter string) *DiskTypesAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *DiskTypesAggregatedListCall) MaxResults(maxResults int64) *DiskTypesAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *DiskTypesAggregatedListCall) PageToken(pageToken string) *DiskTypesAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DiskTypesAggregatedListCall) Fields(s ...googleapi.Field) *DiskTypesAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesAggregatedListCall) IfNoneMatch(entityTag string) *DiskTypesAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DiskTypesAggregatedListCall) Context(ctx context.Context) *DiskTypesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/diskTypes") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.aggregatedList" call. +// Exactly one of *DiskTypeAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DiskTypeAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5203,7 +11007,12 @@ func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *DiskTypeAggregatedList + ret := &DiskTypeAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5217,7 +11026,7 @@ func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -5231,7 +11040,7 @@ func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -5259,40 +11068,56 @@ func (c *DiskTypesAggregatedListCall) Do() (*DiskTypeAggregatedList, error) { // method id "compute.diskTypes.get": type DiskTypesGetCall struct { - s *Service - project string - zone string - diskType string - opt_ map[string]interface{} + s *Service + project string + zone string + diskType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified disk type resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/get func (r *DiskTypesService) Get(project string, zone string, diskType string) *DiskTypesGetCall { - c := &DiskTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &DiskTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.diskType = diskType return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DiskTypesGetCall) Fields(s ...googleapi.Field) *DiskTypesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DiskTypesGetCall) Do() (*DiskType, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesGetCall) IfNoneMatch(entityTag string) *DiskTypesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DiskTypesGetCall) Context(ctx context.Context) *DiskTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes/{diskType}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -5300,7 +11125,33 @@ func (c *DiskTypesGetCall) Do() (*DiskType, error) { "diskType": c.diskType, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.get" call. +// Exactly one of *DiskType or error will be non-nil. 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 error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DiskTypesGetCall) Do() (*DiskType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5308,7 +11159,12 @@ func (c *DiskTypesGetCall) Do() (*DiskType, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *DiskType + ret := &DiskType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5361,77 +11217,124 @@ func (c *DiskTypesGetCall) Do() (*DiskType, error) { // method id "compute.diskTypes.list": type DiskTypesListCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of disk type resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/diskTypes/list func (r *DiskTypesService) List(project string, zone string) *DiskTypesListCall { - c := &DiskTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &DiskTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *DiskTypesListCall) Filter(filter string) *DiskTypesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *DiskTypesListCall) MaxResults(maxResults int64) *DiskTypesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *DiskTypesListCall) PageToken(pageToken string) *DiskTypesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DiskTypesListCall) Fields(s ...googleapi.Field) *DiskTypesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DiskTypesListCall) IfNoneMatch(entityTag string) *DiskTypesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DiskTypesListCall) Context(ctx context.Context) *DiskTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *DiskTypesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/diskTypes") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.diskTypes.list" call. +// Exactly one of *DiskTypeList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *DiskTypeList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5439,7 +11342,12 @@ func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *DiskTypeList + ret := &DiskTypeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5454,7 +11362,7 @@ func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -5468,7 +11376,7 @@ func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -5503,73 +11411,120 @@ func (c *DiskTypesListCall) Do() (*DiskTypeList, error) { // method id "compute.disks.aggregatedList": type DisksAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of disks grouped by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/aggregatedList func (r *DisksService) AggregatedList(project string) *DisksAggregatedListCall { - c := &DisksAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &DisksAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *DisksAggregatedListCall) Filter(filter string) *DisksAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *DisksAggregatedListCall) MaxResults(maxResults int64) *DisksAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *DisksAggregatedListCall) PageToken(pageToken string) *DisksAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DisksAggregatedListCall) Fields(s ...googleapi.Field) *DisksAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksAggregatedListCall) IfNoneMatch(entityTag string) *DisksAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DisksAggregatedListCall) Context(ctx context.Context) *DisksAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *DisksAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/disks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.aggregatedList" call. +// Exactly one of *DiskAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *DiskAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5577,7 +11532,12 @@ func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *DiskAggregatedList + ret := &DiskAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5591,7 +11551,7 @@ func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -5605,7 +11565,7 @@ func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -5633,18 +11593,19 @@ func (c *DisksAggregatedListCall) Do() (*DiskAggregatedList, error) { // method id "compute.disks.createSnapshot": type DisksCreateSnapshotCall struct { - s *Service - project string - zone string - disk string - snapshot *Snapshot - opt_ map[string]interface{} + s *Service + project string + zone string + disk string + snapshot *Snapshot + urlParams_ gensupport.URLParams + ctx_ context.Context } // CreateSnapshot: Creates a snapshot of this disk. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/createSnapshot func (r *DisksService) CreateSnapshot(project string, zone string, disk string, snapshot *Snapshot) *DisksCreateSnapshotCall { - c := &DisksCreateSnapshotCall{s: r.s, opt_: make(map[string]interface{})} + c := &DisksCreateSnapshotCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.disk = disk @@ -5652,28 +11613,32 @@ func (r *DisksService) CreateSnapshot(project string, zone string, disk string, return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DisksCreateSnapshotCall) Fields(s ...googleapi.Field) *DisksCreateSnapshotCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DisksCreateSnapshotCall) Context(ctx context.Context) *DisksCreateSnapshotCall { + c.ctx_ = ctx + return c +} + +func (c *DisksCreateSnapshotCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.snapshot) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}/createSnapshot") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -5682,7 +11647,30 @@ func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.createSnapshot" call. +// Exactly one of *Operation or error will be non-nil. 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 *DisksCreateSnapshotCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5690,7 +11678,12 @@ func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5745,40 +11738,48 @@ func (c *DisksCreateSnapshotCall) Do() (*Operation, error) { // method id "compute.disks.delete": type DisksDeleteCall struct { - s *Service - project string - zone string - disk string - opt_ map[string]interface{} + s *Service + project string + zone string + disk string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified persistent disk. +// Delete: Deletes the specified persistent disk. Deleting a disk +// removes 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. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/delete func (r *DisksService) Delete(project string, zone string, disk string) *DisksDeleteCall { - c := &DisksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &DisksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.disk = disk return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DisksDeleteCall) Fields(s ...googleapi.Field) *DisksDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DisksDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DisksDeleteCall) Context(ctx context.Context) *DisksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *DisksDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -5786,7 +11787,30 @@ func (c *DisksDeleteCall) Do() (*Operation, error) { "disk": c.disk, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *DisksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5794,13 +11818,18 @@ func (c *DisksDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Deletes the specified persistent disk.", + // "description": "Deletes the specified persistent disk. Deleting a disk removes 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.", // "httpMethod": "DELETE", // "id": "compute.disks.delete", // "parameterOrder": [ @@ -5846,40 +11875,56 @@ func (c *DisksDeleteCall) Do() (*Operation, error) { // method id "compute.disks.get": type DisksGetCall struct { - s *Service - project string - zone string - disk string - opt_ map[string]interface{} + s *Service + project string + zone string + disk string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns a specified persistent disk. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/get func (r *DisksService) Get(project string, zone string, disk string) *DisksGetCall { - c := &DisksGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &DisksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.disk = disk return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DisksGetCall) Fields(s ...googleapi.Field) *DisksGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DisksGetCall) Do() (*Disk, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksGetCall) IfNoneMatch(entityTag string) *DisksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DisksGetCall) Context(ctx context.Context) *DisksGetCall { + c.ctx_ = ctx + return c +} + +func (c *DisksGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks/{disk}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -5887,7 +11932,33 @@ func (c *DisksGetCall) Do() (*Disk, error) { "disk": c.disk, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.get" call. +// Exactly one of *Disk or error will be non-nil. 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 +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *DisksGetCall) Do() (*Disk, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -5895,7 +11966,12 @@ func (c *DisksGetCall) Do() (*Disk, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Disk + ret := &Disk{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -5948,18 +12024,19 @@ func (c *DisksGetCall) Do() (*Disk, error) { // method id "compute.disks.insert": type DisksInsertCall struct { - s *Service - project string - zone string - disk *Disk - opt_ map[string]interface{} + s *Service + project string + zone string + disk *Disk + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a persistent disk in the specified project using the // data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/insert func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksInsertCall { - c := &DisksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &DisksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.disk = disk @@ -5969,35 +12046,36 @@ func (r *DisksService) Insert(project string, zone string, disk *Disk) *DisksIns // SourceImage sets the optional parameter "sourceImage": Source image // to restore onto a disk. func (c *DisksInsertCall) SourceImage(sourceImage string) *DisksInsertCall { - c.opt_["sourceImage"] = sourceImage + 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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DisksInsertCall) Fields(s ...googleapi.Field) *DisksInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DisksInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DisksInsertCall) Context(ctx context.Context) *DisksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *DisksInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.disk) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["sourceImage"]; ok { - params.Set("sourceImage", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -6005,7 +12083,30 @@ func (c *DisksInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *DisksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6013,7 +12114,12 @@ func (c *DisksInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6065,77 +12171,124 @@ func (c *DisksInsertCall) Do() (*Operation, error) { // method id "compute.disks.list": type DisksListCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of persistent disks contained within the // specified zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/disks/list func (r *DisksService) List(project string, zone string) *DisksListCall { - c := &DisksListCall{s: r.s, opt_: make(map[string]interface{})} + c := &DisksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *DisksListCall) Filter(filter string) *DisksListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *DisksListCall) MaxResults(maxResults int64) *DisksListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *DisksListCall) PageToken(pageToken string) *DisksListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *DisksListCall) Fields(s ...googleapi.Field) *DisksListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *DisksListCall) Do() (*DiskList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *DisksListCall) IfNoneMatch(entityTag string) *DisksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *DisksListCall) Context(ctx context.Context) *DisksListCall { + c.ctx_ = ctx + return c +} + +func (c *DisksListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/disks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.disks.list" call. +// Exactly one of *DiskList or error will be non-nil. 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 error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *DisksListCall) Do() (*DiskList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6143,7 +12296,12 @@ func (c *DisksListCall) Do() (*DiskList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *DiskList + ret := &DiskList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6158,7 +12316,7 @@ func (c *DisksListCall) Do() (*DiskList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -6172,7 +12330,7 @@ func (c *DisksListCall) Do() (*DiskList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -6207,45 +12365,73 @@ func (c *DisksListCall) Do() (*DiskList, error) { // method id "compute.firewalls.delete": type FirewallsDeleteCall struct { - s *Service - project string - firewall string - opt_ map[string]interface{} + s *Service + project string + firewall string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified firewall resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/delete func (r *FirewallsService) Delete(project string, firewall string) *FirewallsDeleteCall { - c := &FirewallsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &FirewallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewall = firewall return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *FirewallsDeleteCall) Fields(s ...googleapi.Field) *FirewallsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *FirewallsDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FirewallsDeleteCall) Context(ctx context.Context) *FirewallsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "firewall": c.firewall, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *FirewallsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6253,7 +12439,12 @@ func (c *FirewallsDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6297,45 +12488,87 @@ func (c *FirewallsDeleteCall) Do() (*Operation, error) { // method id "compute.firewalls.get": type FirewallsGetCall struct { - s *Service - project string - firewall string - opt_ map[string]interface{} + s *Service + project string + firewall string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified firewall resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/get func (r *FirewallsService) Get(project string, firewall string) *FirewallsGetCall { - c := &FirewallsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &FirewallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewall = firewall return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *FirewallsGetCall) Fields(s ...googleapi.Field) *FirewallsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *FirewallsGetCall) Do() (*Firewall, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FirewallsGetCall) IfNoneMatch(entityTag string) *FirewallsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FirewallsGetCall) Context(ctx context.Context) *FirewallsGetCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "firewall": c.firewall, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.get" call. +// Exactly one of *Firewall or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Firewall.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsGetCall) Do() (*Firewall, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6343,7 +12576,12 @@ func (c *FirewallsGetCall) Do() (*Firewall, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Firewall + ret := &Firewall{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6388,51 +12626,79 @@ func (c *FirewallsGetCall) Do() (*Firewall, error) { // method id "compute.firewalls.insert": type FirewallsInsertCall struct { - s *Service - project string - firewall *Firewall - opt_ map[string]interface{} + s *Service + project string + firewall *Firewall + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a firewall resource in the specified project using // the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/insert func (r *FirewallsService) Insert(project string, firewall *Firewall) *FirewallsInsertCall { - c := &FirewallsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &FirewallsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewall = firewall return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *FirewallsInsertCall) Fields(s ...googleapi.Field) *FirewallsInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *FirewallsInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FirewallsInsertCall) Context(ctx context.Context) *FirewallsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *FirewallsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6440,7 +12706,12 @@ func (c *FirewallsInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6479,74 +12750,121 @@ func (c *FirewallsInsertCall) Do() (*Operation, error) { // method id "compute.firewalls.list": type FirewallsListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of firewall resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/list func (r *FirewallsService) List(project string) *FirewallsListCall { - c := &FirewallsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &FirewallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *FirewallsListCall) Filter(filter string) *FirewallsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *FirewallsListCall) MaxResults(maxResults int64) *FirewallsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *FirewallsListCall) PageToken(pageToken string) *FirewallsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *FirewallsListCall) Fields(s ...googleapi.Field) *FirewallsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *FirewallsListCall) Do() (*FirewallList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *FirewallsListCall) IfNoneMatch(entityTag string) *FirewallsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FirewallsListCall) Context(ctx context.Context) *FirewallsListCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.list" call. +// Exactly one of *FirewallList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *FirewallList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *FirewallsListCall) Do() (*FirewallList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6554,7 +12872,12 @@ func (c *FirewallsListCall) Do() (*FirewallList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *FirewallList + ret := &FirewallList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6568,7 +12891,7 @@ func (c *FirewallsListCall) Do() (*FirewallList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -6582,7 +12905,7 @@ func (c *FirewallsListCall) Do() (*FirewallList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -6610,46 +12933,51 @@ func (c *FirewallsListCall) Do() (*FirewallList, error) { // method id "compute.firewalls.patch": type FirewallsPatchCall struct { - s *Service - project string - firewall string - firewall2 *Firewall - opt_ map[string]interface{} + s *Service + project string + firewall string + firewall2 *Firewall + urlParams_ gensupport.URLParams + ctx_ context.Context } // Patch: Updates the specified firewall resource with the data included // in the request. This method supports patch semantics. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/patch func (r *FirewallsService) Patch(project string, firewall string, firewall2 *Firewall) *FirewallsPatchCall { - c := &FirewallsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c := &FirewallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewall = firewall c.firewall2 = firewall2 return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *FirewallsPatchCall) Fields(s ...googleapi.Field) *FirewallsPatchCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *FirewallsPatchCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FirewallsPatchCall) Context(ctx context.Context) *FirewallsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsPatchCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PATCH", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -6657,7 +12985,30 @@ func (c *FirewallsPatchCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.patch" call. +// Exactly one of *Operation or error will be non-nil. 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 *FirewallsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6665,7 +13016,12 @@ func (c *FirewallsPatchCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6712,46 +13068,51 @@ func (c *FirewallsPatchCall) Do() (*Operation, error) { // method id "compute.firewalls.update": type FirewallsUpdateCall struct { - s *Service - project string - firewall string - firewall2 *Firewall - opt_ map[string]interface{} + s *Service + project string + firewall string + firewall2 *Firewall + urlParams_ gensupport.URLParams + ctx_ context.Context } // Update: Updates the specified firewall resource with the data // included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/firewalls/update func (r *FirewallsService) Update(project string, firewall string, firewall2 *Firewall) *FirewallsUpdateCall { - c := &FirewallsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c := &FirewallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.firewall = firewall c.firewall2 = firewall2 return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *FirewallsUpdateCall) Fields(s ...googleapi.Field) *FirewallsUpdateCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *FirewallsUpdateCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *FirewallsUpdateCall) Context(ctx context.Context) *FirewallsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *FirewallsUpdateCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.firewall2) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/firewalls/{firewall}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PUT", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -6759,7 +13120,30 @@ func (c *FirewallsUpdateCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.firewalls.update" call. +// Exactly one of *Operation or error will be non-nil. 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 *FirewallsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6767,7 +13151,12 @@ func (c *FirewallsUpdateCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6814,74 +13203,121 @@ func (c *FirewallsUpdateCall) Do() (*Operation, error) { // method id "compute.forwardingRules.aggregatedList": type ForwardingRulesAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of forwarding rules grouped by // scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/aggregatedList func (r *ForwardingRulesService) AggregatedList(project string) *ForwardingRulesAggregatedListCall { - c := &ForwardingRulesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &ForwardingRulesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *ForwardingRulesAggregatedListCall) Filter(filter string) *ForwardingRulesAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *ForwardingRulesAggregatedListCall) MaxResults(maxResults int64) *ForwardingRulesAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *ForwardingRulesAggregatedListCall) PageToken(pageToken string) *ForwardingRulesAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ForwardingRulesAggregatedListCall) Fields(s ...googleapi.Field) *ForwardingRulesAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesAggregatedListCall) IfNoneMatch(entityTag string) *ForwardingRulesAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ForwardingRulesAggregatedListCall) Context(ctx context.Context) *ForwardingRulesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/forwardingRules") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.aggregatedList" call. +// Exactly one of *ForwardingRuleAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *ForwardingRuleAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6889,7 +13325,12 @@ func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ForwardingRuleAggregatedList + ret := &ForwardingRuleAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -6903,7 +13344,7 @@ func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -6917,7 +13358,7 @@ func (c *ForwardingRulesAggregatedListCall) Do() (*ForwardingRuleAggregatedList, // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -6949,36 +13390,41 @@ type ForwardingRulesDeleteCall struct { project string region string forwardingRule string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified ForwardingRule resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/delete func (r *ForwardingRulesService) Delete(project string, region string, forwardingRule string) *ForwardingRulesDeleteCall { - c := &ForwardingRulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &ForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.forwardingRule = forwardingRule return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *ForwardingRulesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ForwardingRulesDeleteCall) Context(ctx context.Context) *ForwardingRulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -6986,7 +13432,30 @@ func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { "forwardingRule": c.forwardingRule, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *ForwardingRulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -6994,7 +13463,12 @@ func (c *ForwardingRulesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7050,36 +13524,52 @@ type ForwardingRulesGetCall struct { project string region string forwardingRule string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified ForwardingRule resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/get func (r *ForwardingRulesService) Get(project string, region string, forwardingRule string) *ForwardingRulesGetCall { - c := &ForwardingRulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &ForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.forwardingRule = forwardingRule return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ForwardingRulesGetCall) Fields(s ...googleapi.Field) *ForwardingRulesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesGetCall) IfNoneMatch(entityTag string) *ForwardingRulesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ForwardingRulesGetCall) Context(ctx context.Context) *ForwardingRulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -7087,7 +13577,33 @@ func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { "forwardingRule": c.forwardingRule, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.get" call. +// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ForwardingRule.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7095,7 +13611,12 @@ func (c *ForwardingRulesGetCall) Do() (*ForwardingRule, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ForwardingRule + ret := &ForwardingRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7152,42 +13673,47 @@ type ForwardingRulesInsertCall struct { project string region string forwardingrule *ForwardingRule - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a ForwardingRule resource in the specified project // and region using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/insert func (r *ForwardingRulesService) Insert(project string, region string, forwardingrule *ForwardingRule) *ForwardingRulesInsertCall { - c := &ForwardingRulesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &ForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.forwardingrule = forwardingrule return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ForwardingRulesInsertCall) Fields(s ...googleapi.Field) *ForwardingRulesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ForwardingRulesInsertCall) Context(ctx context.Context) *ForwardingRulesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -7195,7 +13721,30 @@ func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *ForwardingRulesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7203,7 +13752,12 @@ func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7250,77 +13804,124 @@ func (c *ForwardingRulesInsertCall) Do() (*Operation, error) { // method id "compute.forwardingRules.list": type ForwardingRulesListCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of ForwardingRule resources available to the // specified project and region. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/list func (r *ForwardingRulesService) List(project string, region string) *ForwardingRulesListCall { - c := &ForwardingRulesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &ForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *ForwardingRulesListCall) Filter(filter string) *ForwardingRulesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *ForwardingRulesListCall) MaxResults(maxResults int64) *ForwardingRulesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *ForwardingRulesListCall) PageToken(pageToken string) *ForwardingRulesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ForwardingRulesListCall) Fields(s ...googleapi.Field) *ForwardingRulesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ForwardingRulesListCall) IfNoneMatch(entityTag string) *ForwardingRulesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ForwardingRulesListCall) Context(ctx context.Context) *ForwardingRulesListCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.list" call. +// Exactly one of *ForwardingRuleList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ForwardingRuleList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7328,7 +13929,12 @@ func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ForwardingRuleList + ret := &ForwardingRuleList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7343,7 +13949,7 @@ func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -7357,7 +13963,7 @@ func (c *ForwardingRulesListCall) Do() (*ForwardingRuleList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -7397,13 +14003,15 @@ type ForwardingRulesSetTargetCall struct { region string forwardingRule string targetreference *TargetReference - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } -// SetTarget: Changes target url for forwarding rule. +// SetTarget: Changes target url for forwarding rule. The new target +// should be of the same type as the old target. // For details, see https://cloud.google.com/compute/docs/reference/latest/forwardingRules/setTarget func (r *ForwardingRulesService) SetTarget(project string, region string, forwardingRule string, targetreference *TargetReference) *ForwardingRulesSetTargetCall { - c := &ForwardingRulesSetTargetCall{s: r.s, opt_: make(map[string]interface{})} + c := &ForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.forwardingRule = forwardingRule @@ -7411,28 +14019,32 @@ func (r *ForwardingRulesService) SetTarget(project string, region string, forwar return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *ForwardingRulesSetTargetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ForwardingRulesSetTargetCall) Context(ctx context.Context) *ForwardingRulesSetTargetCall { + c.ctx_ = ctx + return c +} + +func (c *ForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -7441,7 +14053,30 @@ func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.forwardingRules.setTarget" call. +// Exactly one of *Operation or error will be non-nil. 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 *ForwardingRulesSetTargetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7449,13 +14084,18 @@ func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Changes target url for forwarding rule.", + // "description": "Changes target url for forwarding rule. The new target should be of the same type as the old target.", // "httpMethod": "POST", // "id": "compute.forwardingRules.setTarget", // "parameterOrder": [ @@ -7504,45 +14144,73 @@ func (c *ForwardingRulesSetTargetCall) Do() (*Operation, error) { // method id "compute.globalAddresses.delete": type GlobalAddressesDeleteCall struct { - s *Service - project string - address string - opt_ map[string]interface{} + s *Service + project string + address string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified address resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/delete func (r *GlobalAddressesService) Delete(project string, address string) *GlobalAddressesDeleteCall { - c := &GlobalAddressesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.address = address return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalAddressesDeleteCall) Fields(s ...googleapi.Field) *GlobalAddressesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalAddressesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalAddressesDeleteCall) Context(ctx context.Context) *GlobalAddressesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "address": c.address, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *GlobalAddressesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7550,7 +14218,12 @@ func (c *GlobalAddressesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7594,45 +14267,87 @@ func (c *GlobalAddressesDeleteCall) Do() (*Operation, error) { // method id "compute.globalAddresses.get": type GlobalAddressesGetCall struct { - s *Service - project string - address string - opt_ map[string]interface{} + s *Service + project string + address string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified address resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/get func (r *GlobalAddressesService) Get(project string, address string) *GlobalAddressesGetCall { - c := &GlobalAddressesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.address = address return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalAddressesGetCall) Fields(s ...googleapi.Field) *GlobalAddressesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalAddressesGetCall) Do() (*Address, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAddressesGetCall) IfNoneMatch(entityTag string) *GlobalAddressesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalAddressesGetCall) Context(ctx context.Context) *GlobalAddressesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses/{address}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "address": c.address, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.get" call. +// Exactly one of *Address or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Address.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *GlobalAddressesGetCall) Do() (*Address, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7640,7 +14355,12 @@ func (c *GlobalAddressesGetCall) Do() (*Address, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Address + ret := &Address{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7685,51 +14405,79 @@ func (c *GlobalAddressesGetCall) Do() (*Address, error) { // method id "compute.globalAddresses.insert": type GlobalAddressesInsertCall struct { - s *Service - project string - address *Address - opt_ map[string]interface{} + s *Service + project string + address *Address + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates an address resource in the specified project using // the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/insert func (r *GlobalAddressesService) Insert(project string, address *Address) *GlobalAddressesInsertCall { - c := &GlobalAddressesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalAddressesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.address = address return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalAddressesInsertCall) Fields(s ...googleapi.Field) *GlobalAddressesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalAddressesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalAddressesInsertCall) Context(ctx context.Context) *GlobalAddressesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.address) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *GlobalAddressesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7737,7 +14485,12 @@ func (c *GlobalAddressesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7776,73 +14529,120 @@ func (c *GlobalAddressesInsertCall) Do() (*Operation, error) { // method id "compute.globalAddresses.list": type GlobalAddressesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of global address resources. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalAddresses/list func (r *GlobalAddressesService) List(project string) *GlobalAddressesListCall { - c := &GlobalAddressesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *GlobalAddressesListCall) Filter(filter string) *GlobalAddressesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *GlobalAddressesListCall) MaxResults(maxResults int64) *GlobalAddressesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *GlobalAddressesListCall) PageToken(pageToken string) *GlobalAddressesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalAddressesListCall) Fields(s ...googleapi.Field) *GlobalAddressesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalAddressesListCall) Do() (*AddressList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalAddressesListCall) IfNoneMatch(entityTag string) *GlobalAddressesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalAddressesListCall) Context(ctx context.Context) *GlobalAddressesListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalAddressesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/addresses") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalAddresses.list" call. +// Exactly one of *AddressList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *AddressList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *GlobalAddressesListCall) Do() (*AddressList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7850,7 +14650,12 @@ func (c *GlobalAddressesListCall) Do() (*AddressList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *AddressList + ret := &AddressList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7864,7 +14669,7 @@ func (c *GlobalAddressesListCall) Do() (*AddressList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -7878,7 +14683,7 @@ func (c *GlobalAddressesListCall) Do() (*AddressList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -7909,42 +14714,70 @@ type GlobalForwardingRulesDeleteCall struct { s *Service project string forwardingRule string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified ForwardingRule resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/delete func (r *GlobalForwardingRulesService) Delete(project string, forwardingRule string) *GlobalForwardingRulesDeleteCall { - c := &GlobalForwardingRulesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalForwardingRulesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.forwardingRule = forwardingRule return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalForwardingRulesDeleteCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalForwardingRulesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalForwardingRulesDeleteCall) Context(ctx context.Context) *GlobalForwardingRulesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "forwardingRule": c.forwardingRule, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *GlobalForwardingRulesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -7952,7 +14785,12 @@ func (c *GlobalForwardingRulesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -7999,42 +14837,84 @@ type GlobalForwardingRulesGetCall struct { s *Service project string forwardingRule string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified ForwardingRule resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/get func (r *GlobalForwardingRulesService) Get(project string, forwardingRule string) *GlobalForwardingRulesGetCall { - c := &GlobalForwardingRulesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalForwardingRulesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.forwardingRule = forwardingRule return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalForwardingRulesGetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalForwardingRulesGetCall) Do() (*ForwardingRule, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalForwardingRulesGetCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalForwardingRulesGetCall) Context(ctx context.Context) *GlobalForwardingRulesGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "forwardingRule": c.forwardingRule, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.get" call. +// Exactly one of *ForwardingRule or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ForwardingRule.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalForwardingRulesGetCall) Do() (*ForwardingRule, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8042,7 +14922,12 @@ func (c *GlobalForwardingRulesGetCall) Do() (*ForwardingRule, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ForwardingRule + ret := &ForwardingRule{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -8090,48 +14975,76 @@ type GlobalForwardingRulesInsertCall struct { s *Service project string forwardingrule *ForwardingRule - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a ForwardingRule resource in the specified project // and region using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/insert func (r *GlobalForwardingRulesService) Insert(project string, forwardingrule *ForwardingRule) *GlobalForwardingRulesInsertCall { - c := &GlobalForwardingRulesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalForwardingRulesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.forwardingrule = forwardingrule return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalForwardingRulesInsertCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalForwardingRulesInsertCall) Context(ctx context.Context) *GlobalForwardingRulesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingrule) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8139,7 +15052,12 @@ func (c *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -8178,74 +15096,121 @@ func (c *GlobalForwardingRulesInsertCall) Do() (*Operation, error) { // method id "compute.globalForwardingRules.list": type GlobalForwardingRulesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of ForwardingRule resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/list func (r *GlobalForwardingRulesService) List(project string) *GlobalForwardingRulesListCall { - c := &GlobalForwardingRulesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalForwardingRulesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *GlobalForwardingRulesListCall) Filter(filter string) *GlobalForwardingRulesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *GlobalForwardingRulesListCall) MaxResults(maxResults int64) *GlobalForwardingRulesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *GlobalForwardingRulesListCall) PageToken(pageToken string) *GlobalForwardingRulesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalForwardingRulesListCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalForwardingRulesListCall) IfNoneMatch(entityTag string) *GlobalForwardingRulesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalForwardingRulesListCall) Context(ctx context.Context) *GlobalForwardingRulesListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.list" call. +// Exactly one of *ForwardingRuleList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *ForwardingRuleList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8253,7 +15218,12 @@ func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ForwardingRuleList + ret := &ForwardingRuleList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -8267,7 +15237,7 @@ func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -8281,7 +15251,7 @@ func (c *GlobalForwardingRulesListCall) Do() (*ForwardingRuleList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -8313,41 +15283,47 @@ type GlobalForwardingRulesSetTargetCall struct { project string forwardingRule string targetreference *TargetReference - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } -// SetTarget: Changes target url for forwarding rule. +// SetTarget: Changes target url for forwarding rule. The new target +// should be of the same type as the old target. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalForwardingRules/setTarget func (r *GlobalForwardingRulesService) SetTarget(project string, forwardingRule string, targetreference *TargetReference) *GlobalForwardingRulesSetTargetCall { - c := &GlobalForwardingRulesSetTargetCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalForwardingRulesSetTargetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.forwardingRule = forwardingRule c.targetreference = targetreference return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalForwardingRulesSetTargetCall) Fields(s ...googleapi.Field) *GlobalForwardingRulesSetTargetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalForwardingRulesSetTargetCall) Context(ctx context.Context) *GlobalForwardingRulesSetTargetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalForwardingRulesSetTargetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/forwardingRules/{forwardingRule}/setTarget") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -8355,7 +15331,30 @@ func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalForwardingRules.setTarget" call. +// Exactly one of *Operation or error will be non-nil. 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 *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8363,13 +15362,18 @@ func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Changes target url for forwarding rule.", + // "description": "Changes target url for forwarding rule. The new target should be of the same type as the old target.", // "httpMethod": "POST", // "id": "compute.globalForwardingRules.setTarget", // "parameterOrder": [ @@ -8410,74 +15414,121 @@ func (c *GlobalForwardingRulesSetTargetCall) Do() (*Operation, error) { // method id "compute.globalOperations.aggregatedList": type GlobalOperationsAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of all operations grouped by // scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/aggregatedList func (r *GlobalOperationsService) AggregatedList(project string) *GlobalOperationsAggregatedListCall { - c := &GlobalOperationsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalOperationsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *GlobalOperationsAggregatedListCall) Filter(filter string) *GlobalOperationsAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *GlobalOperationsAggregatedListCall) MaxResults(maxResults int64) *GlobalOperationsAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *GlobalOperationsAggregatedListCall) PageToken(pageToken string) *GlobalOperationsAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalOperationsAggregatedListCall) Fields(s ...googleapi.Field) *GlobalOperationsAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsAggregatedListCall) IfNoneMatch(entityTag string) *GlobalOperationsAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalOperationsAggregatedListCall) Context(ctx context.Context) *GlobalOperationsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/operations") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.aggregatedList" call. +// Exactly one of *OperationAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *OperationAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8485,7 +15536,12 @@ func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, err if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *OperationAggregatedList + ret := &OperationAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -8499,7 +15555,7 @@ func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, err // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -8513,7 +15569,7 @@ func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, err // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -8541,45 +15597,58 @@ func (c *GlobalOperationsAggregatedListCall) Do() (*OperationAggregatedList, err // method id "compute.globalOperations.delete": type GlobalOperationsDeleteCall struct { - s *Service - project string - operation string - opt_ map[string]interface{} + s *Service + project string + operation string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified operation resource. +// Delete: Deletes the specified Operations resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/delete func (r *GlobalOperationsService) Delete(project string, operation string) *GlobalOperationsDeleteCall { - c := &GlobalOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.operation = operation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalOperationsDeleteCall) Fields(s ...googleapi.Field) *GlobalOperationsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalOperationsDeleteCall) Do() error { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalOperationsDeleteCall) Context(ctx context.Context) *GlobalOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "operation": c.operation, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.delete" call. +func (c *GlobalOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") if err != nil { return err } @@ -8589,7 +15658,7 @@ func (c *GlobalOperationsDeleteCall) Do() error { } return nil // { - // "description": "Deletes the specified operation resource.", + // "description": "Deletes the specified Operations resource.", // "httpMethod": "DELETE", // "id": "compute.globalOperations.delete", // "parameterOrder": [ @@ -8598,7 +15667,7 @@ func (c *GlobalOperationsDeleteCall) Do() error { // ], // "parameters": { // "operation": { - // "description": "Name of the operation resource to delete.", + // "description": "Name of the Operations resource to delete.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -8624,45 +15693,87 @@ func (c *GlobalOperationsDeleteCall) Do() error { // method id "compute.globalOperations.get": type GlobalOperationsGetCall struct { - s *Service - project string - operation string - opt_ map[string]interface{} + s *Service + project string + operation string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// Get: Retrieves the specified operation resource. +// Get: Retrieves the specified Operations resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/get func (r *GlobalOperationsService) Get(project string, operation string) *GlobalOperationsGetCall { - c := &GlobalOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.operation = operation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalOperationsGetCall) Fields(s ...googleapi.Field) *GlobalOperationsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalOperationsGetCall) Do() (*Operation, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsGetCall) IfNoneMatch(entityTag string) *GlobalOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalOperationsGetCall) Context(ctx context.Context) *GlobalOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "operation": c.operation, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.get" call. +// Exactly one of *Operation or error will be non-nil. 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 *GlobalOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8670,13 +15781,18 @@ func (c *GlobalOperationsGetCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the specified operation resource.", + // "description": "Retrieves the specified Operations resource.", // "httpMethod": "GET", // "id": "compute.globalOperations.get", // "parameterOrder": [ @@ -8685,7 +15801,7 @@ func (c *GlobalOperationsGetCall) Do() (*Operation, error) { // ], // "parameters": { // "operation": { - // "description": "Name of the operation resource to return.", + // "description": "Name of the Operations resource to return.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -8715,74 +15831,121 @@ func (c *GlobalOperationsGetCall) Do() (*Operation, error) { // method id "compute.globalOperations.list": type GlobalOperationsListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// List: Retrieves the list of operation resources contained within the +// List: Retrieves the list of Operation resources contained within the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/globalOperations/list func (r *GlobalOperationsService) List(project string) *GlobalOperationsListCall { - c := &GlobalOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &GlobalOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *GlobalOperationsListCall) Filter(filter string) *GlobalOperationsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *GlobalOperationsListCall) MaxResults(maxResults int64) *GlobalOperationsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *GlobalOperationsListCall) PageToken(pageToken string) *GlobalOperationsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *GlobalOperationsListCall) Fields(s ...googleapi.Field) *GlobalOperationsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *GlobalOperationsListCall) Do() (*OperationList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *GlobalOperationsListCall) IfNoneMatch(entityTag string) *GlobalOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *GlobalOperationsListCall) Context(ctx context.Context) *GlobalOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *GlobalOperationsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.globalOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *GlobalOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8790,13 +15953,18 @@ func (c *GlobalOperationsListCall) Do() (*OperationList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *OperationList + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the list of operation resources contained within the specified project.", + // "description": "Retrieves the list of Operation resources contained within the specified project.", // "httpMethod": "GET", // "id": "compute.globalOperations.list", // "parameterOrder": [ @@ -8804,7 +15972,7 @@ func (c *GlobalOperationsListCall) Do() (*OperationList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -8818,7 +15986,7 @@ func (c *GlobalOperationsListCall) Do() (*OperationList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -8849,42 +16017,70 @@ type HttpHealthChecksDeleteCall struct { s *Service project string httpHealthCheck string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified HttpHealthCheck resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/delete func (r *HttpHealthChecksService) Delete(project string, httpHealthCheck string) *HttpHealthChecksDeleteCall { - c := &HttpHealthChecksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &HttpHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.httpHealthCheck = httpHealthCheck return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *HttpHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpHealthChecksDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpHealthChecksDeleteCall) Context(ctx context.Context) *HttpHealthChecksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "httpHealthCheck": c.httpHealthCheck, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpHealthChecksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8892,7 +16088,12 @@ func (c *HttpHealthChecksDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -8939,42 +16140,84 @@ type HttpHealthChecksGetCall struct { s *Service project string httpHealthCheck string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified HttpHealthCheck resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/get func (r *HttpHealthChecksService) Get(project string, httpHealthCheck string) *HttpHealthChecksGetCall { - c := &HttpHealthChecksGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &HttpHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.httpHealthCheck = httpHealthCheck return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *HttpHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpHealthChecksGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpHealthChecksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpHealthChecksGetCall) Context(ctx context.Context) *HttpHealthChecksGetCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "httpHealthCheck": c.httpHealthCheck, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.get" call. +// Exactly one of *HttpHealthCheck or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *HttpHealthCheck.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -8982,7 +16225,12 @@ func (c *HttpHealthChecksGetCall) Do() (*HttpHealthCheck, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *HttpHealthCheck + ret := &HttpHealthCheck{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9030,48 +16278,76 @@ type HttpHealthChecksInsertCall struct { s *Service project string httphealthcheck *HttpHealthCheck - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a HttpHealthCheck resource in the specified project // using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/insert func (r *HttpHealthChecksService) Insert(project string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksInsertCall { - c := &HttpHealthChecksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &HttpHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.httphealthcheck = httphealthcheck return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *HttpHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpHealthChecksInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpHealthChecksInsertCall) Context(ctx context.Context) *HttpHealthChecksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpHealthChecksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9079,7 +16355,12 @@ func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9118,74 +16399,121 @@ func (c *HttpHealthChecksInsertCall) Do() (*Operation, error) { // method id "compute.httpHealthChecks.list": type HttpHealthChecksListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of HttpHealthCheck resources available to // the specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/list func (r *HttpHealthChecksService) List(project string) *HttpHealthChecksListCall { - c := &HttpHealthChecksListCall{s: r.s, opt_: make(map[string]interface{})} + c := &HttpHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *HttpHealthChecksListCall) Filter(filter string) *HttpHealthChecksListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *HttpHealthChecksListCall) MaxResults(maxResults int64) *HttpHealthChecksListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *HttpHealthChecksListCall) PageToken(pageToken string) *HttpHealthChecksListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *HttpHealthChecksListCall) Fields(s ...googleapi.Field) *HttpHealthChecksListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpHealthChecksListCall) IfNoneMatch(entityTag string) *HttpHealthChecksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpHealthChecksListCall) Context(ctx context.Context) *HttpHealthChecksListCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.list" call. +// Exactly one of *HttpHealthCheckList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpHealthCheckList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9193,7 +16521,12 @@ func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *HttpHealthCheckList + ret := &HttpHealthCheckList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9207,7 +16540,7 @@ func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -9221,7 +16554,7 @@ func (c *HttpHealthChecksListCall) Do() (*HttpHealthCheckList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -9253,7 +16586,8 @@ type HttpHealthChecksPatchCall struct { project string httpHealthCheck string httphealthcheck *HttpHealthCheck - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Patch: Updates a HttpHealthCheck resource in the specified project @@ -9261,35 +16595,39 @@ type HttpHealthChecksPatchCall struct { // semantics. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/patch func (r *HttpHealthChecksService) Patch(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksPatchCall { - c := &HttpHealthChecksPatchCall{s: r.s, opt_: make(map[string]interface{})} + c := &HttpHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.httpHealthCheck = httpHealthCheck c.httphealthcheck = httphealthcheck return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *HttpHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpHealthChecksPatchCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpHealthChecksPatchCall) Context(ctx context.Context) *HttpHealthChecksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PATCH", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -9297,7 +16635,30 @@ func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.patch" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpHealthChecksPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9305,7 +16666,12 @@ func (c *HttpHealthChecksPatchCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9356,42 +16722,47 @@ type HttpHealthChecksUpdateCall struct { project string httpHealthCheck string httphealthcheck *HttpHealthCheck - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Update: Updates a HttpHealthCheck resource in the specified project // using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/httpHealthChecks/update func (r *HttpHealthChecksService) Update(project string, httpHealthCheck string, httphealthcheck *HttpHealthCheck) *HttpHealthChecksUpdateCall { - c := &HttpHealthChecksUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c := &HttpHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.httpHealthCheck = httpHealthCheck c.httphealthcheck = httphealthcheck return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *HttpHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpHealthChecksUpdateCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpHealthChecksUpdateCall) Context(ctx context.Context) *HttpHealthChecksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *HttpHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.httphealthcheck) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpHealthChecks/{httpHealthCheck}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PUT", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -9399,7 +16770,30 @@ func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpHealthChecks.update" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpHealthChecksUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9407,7 +16801,12 @@ func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9451,48 +16850,75 @@ func (c *HttpHealthChecksUpdateCall) Do() (*Operation, error) { } -// method id "compute.images.delete": +// method id "compute.httpsHealthChecks.delete": -type ImagesDeleteCall struct { - s *Service - project string - image string - opt_ map[string]interface{} +type HttpsHealthChecksDeleteCall struct { + s *Service + project string + httpsHealthCheck string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified image resource. -// For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete -func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { - c := &ImagesDeleteCall{s: r.s, opt_: make(map[string]interface{})} +// Delete: Deletes the specified HttpsHealthCheck resource. +func (r *HttpsHealthChecksService) Delete(project string, httpsHealthCheck string) *HttpsHealthChecksDeleteCall { + c := &HttpsHealthChecksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.image = image + c.httpsHealthCheck = httpsHealthCheck return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) +func (c *HttpsHealthChecksDeleteCall) Fields(s ...googleapi.Field) *HttpsHealthChecksDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ImagesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpsHealthChecksDeleteCall) Context(ctx context.Context) *HttpsHealthChecksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") - urls += "?" + params.Encode() + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "image": c.image, + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpsHealthChecksDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9500,7 +16926,846 @@ func (c *ImagesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified HttpsHealthCheck resource.", + // "httpMethod": "DELETE", + // "id": "compute.httpsHealthChecks.delete", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.get": + +type HttpsHealthChecksGetCall struct { + s *Service + project string + httpsHealthCheck string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// Get: Returns the specified HttpsHealthCheck resource. +func (r *HttpsHealthChecksService) Get(project string, httpsHealthCheck string) *HttpsHealthChecksGetCall { + c := &HttpsHealthChecksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksGetCall) Fields(s ...googleapi.Field) *HttpsHealthChecksGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpsHealthChecksGetCall) IfNoneMatch(entityTag string) *HttpsHealthChecksGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpsHealthChecksGetCall) Context(ctx context.Context) *HttpsHealthChecksGetCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.get" call. +// Exactly one of *HttpsHealthCheck or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpsHealthCheck.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpsHealthChecksGetCall) Do() (*HttpsHealthCheck, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &HttpsHealthCheck{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified HttpsHealthCheck resource.", + // "httpMethod": "GET", + // "id": "compute.httpsHealthChecks.get", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + // "response": { + // "$ref": "HttpsHealthCheck" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.insert": + +type HttpsHealthChecksInsertCall struct { + s *Service + project string + httpshealthcheck *HttpsHealthCheck + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Insert: Creates a HttpsHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpsHealthChecksService) Insert(project string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksInsertCall { + c := &HttpsHealthChecksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksInsertCall) Fields(s ...googleapi.Field) *HttpsHealthChecksInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpsHealthChecksInsertCall) Context(ctx context.Context) *HttpsHealthChecksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpsHealthChecksInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a HttpsHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.httpsHealthChecks.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpsHealthChecks", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.list": + +type HttpsHealthChecksListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// List: Retrieves the list of HttpsHealthCheck resources available to +// the specified project. +func (r *HttpsHealthChecksService) List(project string) *HttpsHealthChecksListCall { + c := &HttpsHealthChecksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *HttpsHealthChecksListCall) Filter(filter string) *HttpsHealthChecksListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *HttpsHealthChecksListCall) MaxResults(maxResults int64) *HttpsHealthChecksListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *HttpsHealthChecksListCall) PageToken(pageToken string) *HttpsHealthChecksListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksListCall) Fields(s ...googleapi.Field) *HttpsHealthChecksListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *HttpsHealthChecksListCall) IfNoneMatch(entityTag string) *HttpsHealthChecksListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpsHealthChecksListCall) Context(ctx context.Context) *HttpsHealthChecksListCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.list" call. +// Exactly one of *HttpsHealthCheckList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *HttpsHealthCheckList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *HttpsHealthChecksListCall) Do() (*HttpsHealthCheckList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &HttpsHealthCheckList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of HttpsHealthCheck resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.httpsHealthChecks.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpsHealthChecks", + // "response": { + // "$ref": "HttpsHealthCheckList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.patch": + +type HttpsHealthChecksPatchCall struct { + s *Service + project string + httpsHealthCheck string + httpshealthcheck *HttpsHealthCheck + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Patch: Updates a HttpsHealthCheck resource in the specified project +// using the data included in the request. This method supports patch +// semantics. +func (r *HttpsHealthChecksService) Patch(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksPatchCall { + c := &HttpsHealthChecksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksPatchCall) Fields(s ...googleapi.Field) *HttpsHealthChecksPatchCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpsHealthChecksPatchCall) Context(ctx context.Context) *HttpsHealthChecksPatchCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksPatchCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("PATCH", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.patch" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpsHealthChecksPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request. This method supports patch semantics.", + // "httpMethod": "PATCH", + // "id": "compute.httpsHealthChecks.patch", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.httpsHealthChecks.update": + +type HttpsHealthChecksUpdateCall struct { + s *Service + project string + httpsHealthCheck string + httpshealthcheck *HttpsHealthCheck + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Update: Updates a HttpsHealthCheck resource in the specified project +// using the data included in the request. +func (r *HttpsHealthChecksService) Update(project string, httpsHealthCheck string, httpshealthcheck *HttpsHealthCheck) *HttpsHealthChecksUpdateCall { + c := &HttpsHealthChecksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.httpsHealthCheck = httpsHealthCheck + c.httpshealthcheck = httpshealthcheck + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *HttpsHealthChecksUpdateCall) Fields(s ...googleapi.Field) *HttpsHealthChecksUpdateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *HttpsHealthChecksUpdateCall) Context(ctx context.Context) *HttpsHealthChecksUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *HttpsHealthChecksUpdateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpshealthcheck) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/httpsHealthChecks/{httpsHealthCheck}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("PUT", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "httpsHealthCheck": c.httpsHealthCheck, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.httpsHealthChecks.update" call. +// Exactly one of *Operation or error will be non-nil. 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 *HttpsHealthChecksUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Updates a HttpsHealthCheck resource in the specified project using the data included in the request.", + // "httpMethod": "PUT", + // "id": "compute.httpsHealthChecks.update", + // "parameterOrder": [ + // "project", + // "httpsHealthCheck" + // ], + // "parameters": { + // "httpsHealthCheck": { + // "description": "Name of the HttpsHealthCheck resource to update.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/httpsHealthChecks/{httpsHealthCheck}", + // "request": { + // "$ref": "HttpsHealthCheck" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.images.delete": + +type ImagesDeleteCall struct { + s *Service + project string + image string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified image resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/images/delete +func (r *ImagesService) Delete(project string, image string) *ImagesDeleteCall { + c := &ImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.image = image + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *ImagesDeleteCall) Fields(s ...googleapi.Field) *ImagesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ImagesDeleteCall) Context(ctx context.Context) *ImagesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "image": c.image, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *ImagesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9548,7 +17813,8 @@ type ImagesDeprecateCall struct { project string image string deprecationstatus *DeprecationStatus - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Deprecate: Sets the deprecation status of an image. @@ -9557,35 +17823,39 @@ type ImagesDeprecateCall struct { // instead. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/deprecate func (r *ImagesService) Deprecate(project string, image string, deprecationstatus *DeprecationStatus) *ImagesDeprecateCall { - c := &ImagesDeprecateCall{s: r.s, opt_: make(map[string]interface{})} + c := &ImagesDeprecateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.image = image c.deprecationstatus = deprecationstatus return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ImagesDeprecateCall) Fields(s ...googleapi.Field) *ImagesDeprecateCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ImagesDeprecateCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ImagesDeprecateCall) Context(ctx context.Context) *ImagesDeprecateCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesDeprecateCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.deprecationstatus) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}/deprecate") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -9593,7 +17863,30 @@ func (c *ImagesDeprecateCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.deprecate" call. +// Exactly one of *Operation or error will be non-nil. 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 *ImagesDeprecateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9601,7 +17894,12 @@ func (c *ImagesDeprecateCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9648,45 +17946,87 @@ func (c *ImagesDeprecateCall) Do() (*Operation, error) { // method id "compute.images.get": type ImagesGetCall struct { - s *Service - project string - image string - opt_ map[string]interface{} + s *Service + project string + image string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified image resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/get func (r *ImagesService) Get(project string, image string) *ImagesGetCall { - c := &ImagesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &ImagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.image = image return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ImagesGetCall) Fields(s ...googleapi.Field) *ImagesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ImagesGetCall) Do() (*Image, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ImagesGetCall) IfNoneMatch(entityTag string) *ImagesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ImagesGetCall) Context(ctx context.Context) *ImagesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images/{image}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "image": c.image, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.get" call. +// Exactly one of *Image or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Image.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *ImagesGetCall) Do() (*Image, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9694,7 +18034,12 @@ func (c *ImagesGetCall) Do() (*Image, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Image + ret := &Image{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9739,51 +18084,79 @@ func (c *ImagesGetCall) Do() (*Image, error) { // method id "compute.images.insert": type ImagesInsertCall struct { - s *Service - project string - image *Image - opt_ map[string]interface{} + s *Service + project string + image *Image + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates an image resource in the specified project using the // data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/insert func (r *ImagesService) Insert(project string, image *Image) *ImagesInsertCall { - c := &ImagesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &ImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.image = image return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ImagesInsertCall) Fields(s ...googleapi.Field) *ImagesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ImagesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ImagesInsertCall) Context(ctx context.Context) *ImagesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.image) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *ImagesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9791,7 +18164,12 @@ func (c *ImagesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -9833,74 +18211,128 @@ func (c *ImagesInsertCall) Do() (*Operation, error) { // method id "compute.images.list": type ImagesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// List: Retrieves the list of image resources available to the -// specified project. +// List: Retrieves the list of private images available to the specified +// project. Private images are images you create that belong to your +// project. This method does not get any images that belong to other +// projects, including publicly-available images, like Debian 7. If you +// want to get a list of publicly-available images, use this method to +// make a request to the respective image project, such as debian-cloud +// or windows-cloud. +// +// See Accessing images for more information. // For details, see https://cloud.google.com/compute/docs/reference/latest/images/list func (r *ImagesService) List(project string) *ImagesListCall { - c := &ImagesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &ImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *ImagesListCall) Filter(filter string) *ImagesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *ImagesListCall) MaxResults(maxResults int64) *ImagesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *ImagesListCall) PageToken(pageToken string) *ImagesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ImagesListCall) Fields(s ...googleapi.Field) *ImagesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ImagesListCall) Do() (*ImageList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ImagesListCall) IfNoneMatch(entityTag string) *ImagesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ImagesListCall) Context(ctx context.Context) *ImagesListCall { + c.ctx_ = ctx + return c +} + +func (c *ImagesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/images") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.images.list" call. +// Exactly one of *ImageList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *ImageList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ImagesListCall) Do() (*ImageList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -9908,13 +18340,18 @@ func (c *ImagesListCall) Do() (*ImageList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ImageList + ret := &ImageList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the list of image resources available to the specified project.", + // "description": "Retrieves the list of private images available to the specified project. Private images are images you create that belong to your project. This method does not get any images that belong to other projects, including publicly-available images, like Debian 7. If you want to get a list of publicly-available images, use this method to make a request to the respective image project, such as debian-cloud or windows-cloud.\n\nSee Accessing images for more information.", // "httpMethod": "GET", // "id": "compute.images.list", // "parameterOrder": [ @@ -9922,7 +18359,7 @@ func (c *ImagesListCall) Do() (*ImageList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -9936,7 +18373,7 @@ func (c *ImagesListCall) Do() (*ImageList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -9961,48 +18398,94 @@ func (c *ImagesListCall) Do() (*ImageList, error) { } -// method id "compute.instanceTemplates.delete": +// method id "compute.instanceGroupManagers.abandonInstances": -type InstanceTemplatesDeleteCall struct { - s *Service - project string - instanceTemplate string - opt_ map[string]interface{} +type InstanceGroupManagersAbandonInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified instance template. -// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete -func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall { - c := &InstanceTemplatesDeleteCall{s: r.s, opt_: make(map[string]interface{})} +// AbandonInstances: Schedules a group action to remove the specified +// instances 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. +func (r *InstanceGroupManagersService) AbandonInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersabandoninstancesrequest *InstanceGroupManagersAbandonInstancesRequest) *InstanceGroupManagersAbandonInstancesCall { + c := &InstanceGroupManagersAbandonInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.instanceTemplate = instanceTemplate + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersabandoninstancesrequest = instancegroupmanagersabandoninstancesrequest return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *InstanceTemplatesDeleteCall) Fields(s ...googleapi.Field) *InstanceTemplatesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) +func (c *InstanceGroupManagersAbandonInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAbandonInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstanceTemplatesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersAbandonInstancesCall) Context(ctx context.Context) *InstanceGroupManagersAbandonInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAbandonInstancesCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersabandoninstancesrequest) + if err != nil { + return nil, err } - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") - urls += "?" + params.Encode() - req, _ := http.NewRequest("DELETE", urls, body) + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "instanceTemplate": c.instanceTemplate, + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, }) + req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.abandonInstances" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersAbandonInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10010,7 +18493,3222 @@ func (c *InstanceTemplatesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to remove the specified instances 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.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.abandonInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances", + // "request": { + // "$ref": "InstanceGroupManagersAbandonInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.aggregatedList": + +type InstanceGroupManagersAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of managed instance groups and +// groups them by zone. +func (r *InstanceGroupManagersService) AggregatedList(project string) *InstanceGroupManagersAggregatedListCall { + c := &InstanceGroupManagersAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupManagersAggregatedListCall) Filter(filter string) *InstanceGroupManagersAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupManagersAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupManagersAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupManagersAggregatedListCall) PageToken(pageToken string) *InstanceGroupManagersAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersAggregatedListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersAggregatedListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersAggregatedListCall) Context(ctx context.Context) *InstanceGroupManagersAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroupManagers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.aggregatedList" call. +// Exactly one of *InstanceGroupManagerAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *InstanceGroupManagerAggregatedList.ServerResponse.Header or +// (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceGroupManagersAggregatedListCall) Do() (*InstanceGroupManagerAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupManagerAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of managed instance groups and groups them by zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.delete": + +type InstanceGroupManagersDeleteCall struct { + s *Service + project string + zone string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified managed instance group and all of the +// instances in that group. +func (r *InstanceGroupManagersService) Delete(project string, zone string, instanceGroupManager string) *InstanceGroupManagersDeleteCall { + c := &InstanceGroupManagersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *InstanceGroupManagersDeleteCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersDeleteCall) Context(ctx context.Context) *InstanceGroupManagersDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified managed instance group and all of the instances in that group.", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroupManagers.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.deleteInstances": + +type InstanceGroupManagersDeleteInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// DeleteInstances: Schedules a group action to delete the specified +// instances in the managed instance group. 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. This operation is marked as DONE +// when the action is scheduled even if the instances are still being +// deleted. You must separately verify the status of the deleting action +// with the listmanagedinstances method. +func (r *InstanceGroupManagersService) DeleteInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersdeleteinstancesrequest *InstanceGroupManagersDeleteInstancesRequest) *InstanceGroupManagersDeleteInstancesCall { + c := &InstanceGroupManagersDeleteInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersdeleteinstancesrequest = instancegroupmanagersdeleteinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersDeleteInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersDeleteInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersDeleteInstancesCall) Context(ctx context.Context) *InstanceGroupManagersDeleteInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersDeleteInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersdeleteinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.deleteInstances" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersDeleteInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to delete the specified instances in the managed instance group. 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. This operation is marked as DONE when the action is scheduled even if the instances are still being deleted. You must separately verify the status of the deleting action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.deleteInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances", + // "request": { + // "$ref": "InstanceGroupManagersDeleteInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.get": + +type InstanceGroupManagersGetCall struct { + s *Service + project string + zone string + instanceGroupManager string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// Get: Returns all of the details about the specified managed instance +// group. +func (r *InstanceGroupManagersService) Get(project string, zone string, instanceGroupManager string) *InstanceGroupManagersGetCall { + c := &InstanceGroupManagersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *InstanceGroupManagersGetCall) Fields(s ...googleapi.Field) *InstanceGroupManagersGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersGetCall) IfNoneMatch(entityTag string) *InstanceGroupManagersGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersGetCall) Context(ctx context.Context) *InstanceGroupManagersGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.get" call. +// Exactly one of *InstanceGroupManager or error will be non-nil. 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 *InstanceGroupManagersGetCall) Do() (*InstanceGroupManager, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupManager{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns all of the details about the specified managed instance group.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}", + // "response": { + // "$ref": "InstanceGroupManager" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.insert": + +type InstanceGroupManagersInsertCall struct { + s *Service + project string + zone string + instancegroupmanager *InstanceGroupManager + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Insert: Creates a managed instance group using the information that +// you specify in the request. After the group is created, it schedules +// an action to create instances in the group 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. +func (r *InstanceGroupManagersService) Insert(project string, zone string, instancegroupmanager *InstanceGroupManager) *InstanceGroupManagersInsertCall { + c := &InstanceGroupManagersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *InstanceGroupManagersInsertCall) Fields(s ...googleapi.Field) *InstanceGroupManagersInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersInsertCall) Context(ctx context.Context) *InstanceGroupManagersInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanager) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a managed instance group using the information that you specify in the request. After the group is created, it schedules an action to create instances in the group 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.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where you want to create the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "request": { + // "$ref": "InstanceGroupManager" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.list": + +type InstanceGroupManagersListCall struct { + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// List: Retrieves a list of managed instance groups that are contained +// within the specified project and zone. +func (r *InstanceGroupManagersService) List(project string, zone string) *InstanceGroupManagersListCall { + c := &InstanceGroupManagersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupManagersListCall) Filter(filter string) *InstanceGroupManagersListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupManagersListCall) MaxResults(maxResults int64) *InstanceGroupManagersListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupManagersListCall) PageToken(pageToken string) *InstanceGroupManagersListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersListCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *InstanceGroupManagersListCall) IfNoneMatch(entityTag string) *InstanceGroupManagersListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersListCall) Context(ctx context.Context) *InstanceGroupManagersListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.list" call. +// Exactly one of *InstanceGroupManagerList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *InstanceGroupManagerList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *InstanceGroupManagersListCall) Do() (*InstanceGroupManagerList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupManagerList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves a list of managed instance groups that are contained within the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroupManagers.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers", + // "response": { + // "$ref": "InstanceGroupManagerList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.listManagedInstances": + +type InstanceGroupManagersListManagedInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// ListManagedInstances: Lists all of the instances in the managed +// instance group. Each instance in the list has a currentAction, which +// indicates the action that the managed instance group is performing on +// the instance. For example, if the group is still creating an +// instance, the currentAction is CREATING. If a previous action failed, +// the list displays the errors for that failed action. +func (r *InstanceGroupManagersService) ListManagedInstances(project string, zone string, instanceGroupManager string) *InstanceGroupManagersListManagedInstancesCall { + c := &InstanceGroupManagersListManagedInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + 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 information. +func (c *InstanceGroupManagersListManagedInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersListManagedInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersListManagedInstancesCall) Context(ctx context.Context) *InstanceGroupManagersListManagedInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersListManagedInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.listManagedInstances" call. +// Exactly one of *InstanceGroupManagersListManagedInstancesResponse or +// error will be non-nil. Any non-2xx status code is an error. Response +// headers are in either +// *InstanceGroupManagersListManagedInstancesResponse.ServerResponse.Head +// er or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *InstanceGroupManagersListManagedInstancesCall) Do() (*InstanceGroupManagersListManagedInstancesResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupManagersListManagedInstancesResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.listManagedInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances", + // "response": { + // "$ref": "InstanceGroupManagersListManagedInstancesResponse" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.recreateInstances": + +type InstanceGroupManagersRecreateInstancesCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// RecreateInstances: Schedules a group action to recreate the specified +// instances in the managed instance group. The instances are deleted +// and recreated using the current instance template for the managed +// instance group. This operation is marked as DONE when the action is +// scheduled even if the instances have not yet been recreated. You must +// separately verify the status of the recreating action with the +// listmanagedinstances method. +func (r *InstanceGroupManagersService) RecreateInstances(project string, zone string, instanceGroupManager string, instancegroupmanagersrecreateinstancesrequest *InstanceGroupManagersRecreateInstancesRequest) *InstanceGroupManagersRecreateInstancesCall { + c := &InstanceGroupManagersRecreateInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagersrecreateinstancesrequest = instancegroupmanagersrecreateinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersRecreateInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupManagersRecreateInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersRecreateInstancesCall) Context(ctx context.Context) *InstanceGroupManagersRecreateInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersRecreateInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagersrecreateinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.recreateInstances" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersRecreateInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Schedules a group action to recreate the specified instances in the managed instance group. The instances are deleted and recreated using the current instance template for the managed instance group. This operation is marked as DONE when the action is scheduled even if the instances have not yet been recreated. You must separately verify the status of the recreating action with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.recreateInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances", + // "request": { + // "$ref": "InstanceGroupManagersRecreateInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.resize": + +type InstanceGroupManagersResizeCall struct { + s *Service + project string + zone string + instanceGroupManager string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Resize: Resizes 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 instances. The resize +// operation is marked DONE when the resize actions are scheduled even +// if the group has not yet added or deleted any instances. You must +// separately verify the status of the creating or deleting actions with +// the listmanagedinstances method. +func (r *InstanceGroupManagersService) Resize(project string, zone string, instanceGroupManager string, size int64) *InstanceGroupManagersResizeCall { + c := &InstanceGroupManagersResizeCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.urlParams_.Set("size", fmt.Sprint(size)) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersResizeCall) Fields(s ...googleapi.Field) *InstanceGroupManagersResizeCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersResizeCall) Context(ctx context.Context) *InstanceGroupManagersResizeCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersResizeCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.resize" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersResizeCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Resizes 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 instances. The resize operation is marked DONE when the resize actions are scheduled even if the group has not yet added or deleted any instances. You must separately verify the status of the creating or deleting actions with the listmanagedinstances method.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.resize", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager", + // "size" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "size": { + // "description": "The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter.", + // "format": "int32", + // "location": "query", + // "required": true, + // "type": "integer" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setInstanceTemplate": + +type InstanceGroupManagersSetInstanceTemplateCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// SetInstanceTemplate: 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 recreate them. +func (r *InstanceGroupManagersService) SetInstanceTemplate(project string, zone string, instanceGroupManager string, instancegroupmanagerssetinstancetemplaterequest *InstanceGroupManagersSetInstanceTemplateRequest) *InstanceGroupManagersSetInstanceTemplateCall { + c := &InstanceGroupManagersSetInstanceTemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssetinstancetemplaterequest = instancegroupmanagerssetinstancetemplaterequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetInstanceTemplateCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersSetInstanceTemplateCall) Context(ctx context.Context) *InstanceGroupManagersSetInstanceTemplateCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetInstanceTemplateCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssetinstancetemplaterequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setInstanceTemplate" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersSetInstanceTemplateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "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 recreate them.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setInstanceTemplate", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate", + // "request": { + // "$ref": "InstanceGroupManagersSetInstanceTemplateRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroupManagers.setTargetPools": + +type InstanceGroupManagersSetTargetPoolsCall struct { + s *Service + project string + zone string + instanceGroupManager string + instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// SetTargetPools: Modifies the target pools to which all instances in +// this managed instance group are assigned. The target pools +// automatically apply to all of the instances in the managed instance +// group. This operation is marked DONE when you make the request even +// if the instances have not yet been added to their target pools. The +// change might take some time to apply to all of the instances in the +// group depending on the size of the group. +func (r *InstanceGroupManagersService) SetTargetPools(project string, zone string, instanceGroupManager string, instancegroupmanagerssettargetpoolsrequest *InstanceGroupManagersSetTargetPoolsRequest) *InstanceGroupManagersSetTargetPoolsCall { + c := &InstanceGroupManagersSetTargetPoolsCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.zone = zone + c.instanceGroupManager = instanceGroupManager + c.instancegroupmanagerssettargetpoolsrequest = instancegroupmanagerssettargetpoolsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupManagersSetTargetPoolsCall) Fields(s ...googleapi.Field) *InstanceGroupManagersSetTargetPoolsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupManagersSetTargetPoolsCall) Context(ctx context.Context) *InstanceGroupManagersSetTargetPoolsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupManagersSetTargetPoolsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupmanagerssettargetpoolsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroupManager": c.instanceGroupManager, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroupManagers.setTargetPools" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupManagersSetTargetPoolsCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Modifies the target pools to which all instances in this managed instance group are assigned. The target pools automatically apply to all of the instances in the managed instance group. This operation is marked DONE when you make the request even if the instances have not yet been added to their target pools. The change might take some time to apply to all of the instances in the group depending on the size of the group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroupManagers.setTargetPools", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroupManager" + // ], + // "parameters": { + // "instanceGroupManager": { + // "description": "The name of the managed instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the managed instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools", + // "request": { + // "$ref": "InstanceGroupManagersSetTargetPoolsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.addInstances": + +type InstanceGroupsAddInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsaddinstancesrequest *InstanceGroupsAddInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// 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. +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 +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsAddInstancesCall) Context(ctx context.Context) *InstanceGroupsAddInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsAddInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsaddinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.addInstances" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "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.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.addInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where you are adding instances.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances", + // "request": { + // "$ref": "InstanceGroupsAddInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.aggregatedList": + +type InstanceGroupsAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of instance groups and sorts them +// by zone. +func (r *InstanceGroupsService) AggregatedList(project string) *InstanceGroupsAggregatedListCall { + c := &InstanceGroupsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsAggregatedListCall) Filter(filter string) *InstanceGroupsAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsAggregatedListCall) MaxResults(maxResults int64) *InstanceGroupsAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsAggregatedListCall) PageToken(pageToken string) *InstanceGroupsAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsAggregatedListCall) Fields(s ...googleapi.Field) *InstanceGroupsAggregatedListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsAggregatedListCall) Context(ctx context.Context) *InstanceGroupsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instanceGroups") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.aggregatedList" call. +// Exactly one of *InstanceGroupAggregatedList or error will be non-nil. +// 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() (*InstanceGroupAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance groups and sorts them by zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/aggregated/instanceGroups", + // "response": { + // "$ref": "InstanceGroupAggregatedList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.delete": + +type InstanceGroupsDeleteCall struct { + s *Service + project string + zone string + instanceGroup string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified instance group. The instances in the +// group are not deleted. +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 + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsDeleteCall) Context(ctx context.Context) *InstanceGroupsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.delete" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified instance group. The instances in the group are not deleted.", + // "httpMethod": "DELETE", + // "id": "compute.instanceGroups.delete", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group to delete.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.get": + +type InstanceGroupsGetCall struct { + s *Service + project string + zone string + instanceGroup string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// Get: Returns the specified instance group resource. +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 + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsGetCall) Fields(s ...googleapi.Field) *InstanceGroupsGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsGetCall) Context(ctx context.Context) *InstanceGroupsGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.get" call. +// Exactly one of *InstanceGroup or error will be non-nil. 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() (*InstanceGroup, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroup{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified instance group resource.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.get", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}", + // "response": { + // "$ref": "InstanceGroup" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.insert": + +type InstanceGroupsInsertCall struct { + s *Service + project string + zone string + instancegroup *InstanceGroup + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Insert: Creates an instance group in the specified project using the +// parameters that are included in the request. +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 +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsInsertCall) Context(ctx context.Context) *InstanceGroupsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroup) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.insert" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates an instance group in the specified project using the parameters that are included in the request.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.insert", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where you want to create the instance group.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups", + // "request": { + // "$ref": "InstanceGroup" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.list": + +type InstanceGroupsListCall struct { + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// List: Retrieves the list of instance groups that are located in the +// specified project and zone. +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": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsListCall) Filter(filter string) *InstanceGroupsListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsListCall) MaxResults(maxResults int64) *InstanceGroupsListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsListCall) PageToken(pageToken string) *InstanceGroupsListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsListCall) Fields(s ...googleapi.Field) *InstanceGroupsListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsListCall) Context(ctx context.Context) *InstanceGroupsListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.list" call. +// Exactly one of *InstanceGroupList or error will be non-nil. 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() (*InstanceGroupList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of instance groups that are located in the specified project and zone.", + // "httpMethod": "GET", + // "id": "compute.instanceGroups.list", + // "parameterOrder": [ + // "project", + // "zone" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups", + // "response": { + // "$ref": "InstanceGroupList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.listInstances": + +type InstanceGroupsListInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupslistinstancesrequest *InstanceGroupsListInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// ListInstances: Lists the instances in the specified instance group. +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.instanceGroup = instanceGroup + c.instancegroupslistinstancesrequest = instancegroupslistinstancesrequest + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *InstanceGroupsListInstancesCall) Filter(filter string) *InstanceGroupsListInstancesCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *InstanceGroupsListInstancesCall) MaxResults(maxResults int64) *InstanceGroupsListInstancesCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *InstanceGroupsListInstancesCall) PageToken(pageToken string) *InstanceGroupsListInstancesCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsListInstancesCall) Fields(s ...googleapi.Field) *InstanceGroupsListInstancesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsListInstancesCall) Context(ctx context.Context) *InstanceGroupsListInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsListInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupslistinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.listInstances" call. +// Exactly one of *InstanceGroupsListInstances or error will be non-nil. +// 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() (*InstanceGroupsListInstances, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &InstanceGroupsListInstances{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Lists the instances in the specified instance group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.listInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "instanceGroup": { + // "description": "The name of the instance group from which you want to generate a list of included instances.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances", + // "request": { + // "$ref": "InstanceGroupsListInstancesRequest" + // }, + // "response": { + // "$ref": "InstanceGroupsListInstances" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.instanceGroups.removeInstances": + +type InstanceGroupsRemoveInstancesCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupsremoveinstancesrequest *InstanceGroupsRemoveInstancesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// RemoveInstances: Removes one or more instances from the specified +// instance group, but does not delete those instances. +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.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupsremoveinstancesrequest = instancegroupsremoveinstancesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsRemoveInstancesCall) Context(ctx context.Context) *InstanceGroupsRemoveInstancesCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsRemoveInstancesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupsremoveinstancesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.removeInstances" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstanceGroupsRemoveInstancesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Removes one or more instances from the specified instance group, but does not delete those instances.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.removeInstances", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where the specified instances will be removed.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances", + // "request": { + // "$ref": "InstanceGroupsRemoveInstancesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceGroups.setNamedPorts": + +type InstanceGroupsSetNamedPortsCall struct { + s *Service + project string + zone string + instanceGroup string + instancegroupssetnamedportsrequest *InstanceGroupsSetNamedPortsRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// SetNamedPorts: Sets the named ports for the specified instance group. +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.zone = zone + c.instanceGroup = instanceGroup + c.instancegroupssetnamedportsrequest = instancegroupssetnamedportsrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *InstanceGroupsSetNamedPortsCall) Fields(s ...googleapi.Field) *InstanceGroupsSetNamedPortsCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceGroupsSetNamedPortsCall) Context(ctx context.Context) *InstanceGroupsSetNamedPortsCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceGroupsSetNamedPortsCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancegroupssetnamedportsrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "zone": c.zone, + "instanceGroup": c.instanceGroup, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceGroups.setNamedPorts" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Sets the named ports for the specified instance group.", + // "httpMethod": "POST", + // "id": "compute.instanceGroups.setNamedPorts", + // "parameterOrder": [ + // "project", + // "zone", + // "instanceGroup" + // ], + // "parameters": { + // "instanceGroup": { + // "description": "The name of the instance group where the named ports are updated.", + // "location": "path", + // "required": true, + // "type": "string" + // }, + // "project": { + // "description": "The 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "zone": { + // "description": "The name of the zone where the instance group is located.", + // "location": "path", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts", + // "request": { + // "$ref": "InstanceGroupsSetNamedPortsRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.instanceTemplates.delete": + +type InstanceTemplatesDeleteCall struct { + s *Service + project string + instanceTemplate string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified instance template. +// For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/delete +func (r *InstanceTemplatesService) Delete(project string, instanceTemplate string) *InstanceTemplatesDeleteCall { + c := &InstanceTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + 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 information. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceTemplatesDeleteCall) Context(ctx context.Context) *InstanceTemplatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "instanceTemplate": c.instanceTemplate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.delete" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10057,42 +21755,84 @@ type InstanceTemplatesGetCall struct { s *Service project string instanceTemplate string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified instance template resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/get func (r *InstanceTemplatesService) Get(project string, instanceTemplate string) *InstanceTemplatesGetCall { - c := &InstanceTemplatesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstanceTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.instanceTemplate = instanceTemplate return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstanceTemplatesGetCall) Fields(s ...googleapi.Field) *InstanceTemplatesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstanceTemplatesGetCall) Do() (*InstanceTemplate, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceTemplatesGetCall) Context(ctx context.Context) *InstanceTemplatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates/{instanceTemplate}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "instanceTemplate": c.instanceTemplate, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.get" call. +// Exactly one of *InstanceTemplate or error will be non-nil. 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() (*InstanceTemplate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10100,7 +21840,12 @@ func (c *InstanceTemplatesGetCall) Do() (*InstanceTemplate, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *InstanceTemplate + ret := &InstanceTemplate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10148,48 +21893,76 @@ type InstanceTemplatesInsertCall struct { s *Service project string instancetemplate *InstanceTemplate - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates an instance template in the specified project using // the data that is included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/insert func (r *InstanceTemplatesService) Insert(project string, instancetemplate *InstanceTemplate) *InstanceTemplatesInsertCall { - c := &InstanceTemplatesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstanceTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.instancetemplate = instancetemplate return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstanceTemplatesInsertCall) Fields(s ...googleapi.Field) *InstanceTemplatesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstanceTemplatesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceTemplatesInsertCall) Context(ctx context.Context) *InstanceTemplatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancetemplate) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.insert" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10197,7 +21970,12 @@ func (c *InstanceTemplatesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10236,74 +22014,121 @@ func (c *InstanceTemplatesInsertCall) Do() (*Operation, error) { // method id "compute.instanceTemplates.list": type InstanceTemplatesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves a list of instance templates that are contained // within the specified project and zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/instanceTemplates/list func (r *InstanceTemplatesService) List(project string) *InstanceTemplatesListCall { - c := &InstanceTemplatesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstanceTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *InstanceTemplatesListCall) Filter(filter string) *InstanceTemplatesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *InstanceTemplatesListCall) MaxResults(maxResults int64) *InstanceTemplatesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *InstanceTemplatesListCall) PageToken(pageToken string) *InstanceTemplatesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstanceTemplatesListCall) Fields(s ...googleapi.Field) *InstanceTemplatesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstanceTemplatesListCall) Context(ctx context.Context) *InstanceTemplatesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstanceTemplatesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/instanceTemplates") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instanceTemplates.list" call. +// Exactly one of *InstanceTemplateList or error will be non-nil. 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() (*InstanceTemplateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10311,7 +22136,12 @@ func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *InstanceTemplateList + ret := &InstanceTemplateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10325,7 +22155,7 @@ func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -10339,7 +22169,7 @@ func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -10367,51 +22197,54 @@ func (c *InstanceTemplatesListCall) Do() (*InstanceTemplateList, error) { // method id "compute.instances.addAccessConfig": type InstancesAddAccessConfigCall struct { - s *Service - project string - zone string - instance string - networkInterface string - accessconfig *AccessConfig - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + accessconfig *AccessConfig + urlParams_ gensupport.URLParams + ctx_ context.Context } // AddAccessConfig: Adds an access config to an instance's network // interface. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/addAccessConfig func (r *InstancesService) AddAccessConfig(project string, zone string, instance string, networkInterface string, accessconfig *AccessConfig) *InstancesAddAccessConfigCall { - c := &InstancesAddAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesAddAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.networkInterface = networkInterface + c.urlParams_.Set("networkInterface", networkInterface) c.accessconfig = accessconfig return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesAddAccessConfigCall) Fields(s ...googleapi.Field) *InstancesAddAccessConfigCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesAddAccessConfigCall) Context(ctx context.Context) *InstancesAddAccessConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAddAccessConfigCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.accessconfig) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/addAccessConfig") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -10420,7 +22253,30 @@ func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.addAccessConfig" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstancesAddAccessConfigCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10428,7 +22284,12 @@ func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10490,73 +22351,120 @@ func (c *InstancesAddAccessConfigCall) Do() (*Operation, error) { // method id "compute.instances.aggregatedList": type InstancesAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// AggregatedList: +// AggregatedList: Retrieves aggregated list of instance resources. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/aggregatedList func (r *InstancesService) AggregatedList(project string) *InstancesAggregatedListCall { - c := &InstancesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *InstancesAggregatedListCall) Filter(filter string) *InstancesAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *InstancesAggregatedListCall) MaxResults(maxResults int64) *InstancesAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *InstancesAggregatedListCall) PageToken(pageToken string) *InstancesAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesAggregatedListCall) Fields(s ...googleapi.Field) *InstancesAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesAggregatedListCall) Context(ctx context.Context) *InstancesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/instances") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.aggregatedList" call. +// Exactly one of *InstanceAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *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() (*InstanceAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10564,12 +22472,18 @@ func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *InstanceAggregatedList + ret := &InstanceAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { + // "description": "Retrieves aggregated list of instance resources.", // "httpMethod": "GET", // "id": "compute.instances.aggregatedList", // "parameterOrder": [ @@ -10577,7 +22491,7 @@ func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -10591,7 +22505,7 @@ func (c *InstancesAggregatedListCall) Do() (*InstanceAggregatedList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -10624,13 +22538,14 @@ type InstancesAttachDiskCall struct { zone string instance string attacheddisk *AttachedDisk - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // AttachDisk: Attaches a Disk resource to an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/attachDisk func (r *InstancesService) AttachDisk(project string, zone string, instance string, attacheddisk *AttachedDisk) *InstancesAttachDiskCall { - c := &InstancesAttachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesAttachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance @@ -10638,28 +22553,32 @@ func (r *InstancesService) AttachDisk(project string, zone string, instance stri return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesAttachDiskCall) Fields(s ...googleapi.Field) *InstancesAttachDiskCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesAttachDiskCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesAttachDiskCall) Context(ctx context.Context) *InstancesAttachDiskCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesAttachDiskCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.attacheddisk) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/attachDisk") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -10668,7 +22587,30 @@ func (c *InstancesAttachDiskCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.attachDisk" call. +// Exactly one of *Operation or error will be non-nil. 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 *InstancesAttachDiskCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10676,7 +22618,12 @@ func (c *InstancesAttachDiskCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10731,41 +22678,46 @@ func (c *InstancesAttachDiskCall) Do() (*Operation, error) { // method id "compute.instances.delete": type InstancesDeleteCall struct { - s *Service - project string - zone string - instance string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified Instance resource. For more // information, see Shutting down an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/delete func (r *InstancesService) Delete(project string, zone string, instance string) *InstancesDeleteCall { - c := &InstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesDeleteCall) Fields(s ...googleapi.Field) *InstancesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesDeleteCall) Context(ctx context.Context) *InstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -10773,7 +22725,30 @@ func (c *InstancesDeleteCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.delete" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10781,7 +22756,12 @@ func (c *InstancesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10833,47 +22813,48 @@ func (c *InstancesDeleteCall) Do() (*Operation, error) { // method id "compute.instances.deleteAccessConfig": type InstancesDeleteAccessConfigCall struct { - s *Service - project string - zone string - instance string - accessConfig string - networkInterface string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context } // DeleteAccessConfig: Deletes an access config from an instance's // network interface. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/deleteAccessConfig func (r *InstancesService) DeleteAccessConfig(project string, zone string, instance string, accessConfig string, networkInterface string) *InstancesDeleteAccessConfigCall { - c := &InstancesDeleteAccessConfigCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesDeleteAccessConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.accessConfig = accessConfig - c.networkInterface = networkInterface + c.urlParams_.Set("accessConfig", accessConfig) + 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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesDeleteAccessConfigCall) Fields(s ...googleapi.Field) *InstancesDeleteAccessConfigCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesDeleteAccessConfigCall) Context(ctx context.Context) *InstancesDeleteAccessConfigCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDeleteAccessConfigCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - params.Set("accessConfig", fmt.Sprintf("%v", c.accessConfig)) - params.Set("networkInterface", fmt.Sprintf("%v", c.networkInterface)) - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/deleteAccessConfig") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -10881,7 +22862,30 @@ func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.deleteAccessConfig" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -10889,7 +22893,12 @@ func (c *InstancesDeleteAccessConfigCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -10959,39 +22968,42 @@ type InstancesDetachDiskCall struct { project string zone string instance string - deviceName string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // DetachDisk: Detaches a disk from an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/detachDisk func (r *InstancesService) DetachDisk(project string, zone string, instance string, deviceName string) *InstancesDetachDiskCall { - c := &InstancesDetachDiskCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesDetachDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.deviceName = deviceName + c.urlParams_.Set("deviceName", deviceName) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesDetachDiskCall) Fields(s ...googleapi.Field) *InstancesDetachDiskCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesDetachDiskCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesDetachDiskCall) Context(ctx context.Context) *InstancesDetachDiskCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesDetachDiskCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/detachDisk") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -10999,7 +23011,30 @@ func (c *InstancesDetachDiskCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.detachDisk" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11007,7 +23042,12 @@ func (c *InstancesDetachDiskCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11067,40 +23107,56 @@ func (c *InstancesDetachDiskCall) Do() (*Operation, error) { // method id "compute.instances.get": type InstancesGetCall struct { - s *Service - project string - zone string - instance string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified instance resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/get func (r *InstancesService) Get(project string, zone string, instance string) *InstancesGetCall { - c := &InstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesGetCall) Fields(s ...googleapi.Field) *InstancesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesGetCall) Do() (*Instance, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesGetCall) Context(ctx context.Context) *InstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11108,7 +23164,33 @@ func (c *InstancesGetCall) Do() (*Instance, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.get" call. +// Exactly one of *Instance or error will be non-nil. 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() (*Instance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11116,7 +23198,12 @@ func (c *InstancesGetCall) Do() (*Instance, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Instance + ret := &Instance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11146,7 +23233,7 @@ func (c *InstancesGetCall) Do() (*Instance, error) { // "type": "string" // }, // "zone": { - // "description": "The name of the The name of the zone for this request..", + // "description": "The name of the zone for this request.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -11169,51 +23256,64 @@ func (c *InstancesGetCall) Do() (*Instance, error) { // method id "compute.instances.getSerialPortOutput": type InstancesGetSerialPortOutputCall struct { - s *Service - project string - zone string - instance string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // GetSerialPortOutput: Returns the specified instance's serial port // output. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/getSerialPortOutput func (r *InstancesService) GetSerialPortOutput(project string, zone string, instance string) *InstancesGetSerialPortOutputCall { - c := &InstancesGetSerialPortOutputCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesGetSerialPortOutputCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Port sets the optional parameter "port": Which COM port to retrieve -// data from. +// Port sets the optional parameter "port": Specifies which COM or +// serial port to retrieve data from. func (c *InstancesGetSerialPortOutputCall) Port(port int64) *InstancesGetSerialPortOutputCall { - c.opt_["port"] = port + c.urlParams_.Set("port", fmt.Sprint(port)) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesGetSerialPortOutputCall) Fields(s ...googleapi.Field) *InstancesGetSerialPortOutputCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesGetSerialPortOutputCall) Context(ctx context.Context) *InstancesGetSerialPortOutputCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesGetSerialPortOutputCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["port"]; ok { - params.Set("port", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/serialPort") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11221,7 +23321,33 @@ func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.getSerialPortOutput" call. +// Exactly one of *SerialPortOutput or error will be non-nil. 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() (*SerialPortOutput, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11229,7 +23355,12 @@ func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *SerialPortOutput + ret := &SerialPortOutput{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11253,7 +23384,7 @@ func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { // }, // "port": { // "default": "1", - // "description": "Which COM port to retrieve data from.", + // "description": "Specifies which COM or serial port to retrieve data from.", // "format": "int32", // "location": "query", // "maximum": "4", @@ -11291,46 +23422,51 @@ func (c *InstancesGetSerialPortOutputCall) Do() (*SerialPortOutput, error) { // method id "compute.instances.insert": type InstancesInsertCall struct { - s *Service - project string - zone string - instance *Instance - opt_ map[string]interface{} + s *Service + project string + zone string + instance *Instance + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates an instance resource in the specified project using // the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/insert func (r *InstancesService) Insert(project string, zone string, instance *Instance) *InstancesInsertCall { - c := &InstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesInsertCall) Fields(s ...googleapi.Field) *InstancesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesInsertCall) Context(ctx context.Context) *InstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11338,7 +23474,30 @@ func (c *InstancesInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.insert" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11346,7 +23505,12 @@ func (c *InstancesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11393,77 +23557,124 @@ func (c *InstancesInsertCall) Do() (*Operation, error) { // method id "compute.instances.list": type InstancesListCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of instance resources contained within the // specified zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/list func (r *InstancesService) List(project string, zone string) *InstancesListCall { - c := &InstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *InstancesListCall) Filter(filter string) *InstancesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *InstancesListCall) MaxResults(maxResults int64) *InstancesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *InstancesListCall) PageToken(pageToken string) *InstancesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesListCall) Fields(s ...googleapi.Field) *InstancesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesListCall) Do() (*InstanceList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesListCall) Context(ctx context.Context) *InstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.list" call. +// Exactly one of *InstanceList or error will be non-nil. 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() (*InstanceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11471,7 +23682,12 @@ func (c *InstancesListCall) Do() (*InstanceList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *InstanceList + ret := &InstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11486,7 +23702,7 @@ func (c *InstancesListCall) Do() (*InstanceList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -11500,7 +23716,7 @@ func (c *InstancesListCall) Do() (*InstanceList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -11535,40 +23751,45 @@ func (c *InstancesListCall) Do() (*InstanceList, error) { // method id "compute.instances.reset": type InstancesResetCall struct { - s *Service - project string - zone string - instance string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Reset: Performs a hard reset on the instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/reset func (r *InstancesService) Reset(project string, zone string, instance string) *InstancesResetCall { - c := &InstancesResetCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesResetCall) Fields(s ...googleapi.Field) *InstancesResetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesResetCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesResetCall) Context(ctx context.Context) *InstancesResetCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesResetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/reset") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11576,7 +23797,30 @@ func (c *InstancesResetCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.reset" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11584,7 +23828,12 @@ func (c *InstancesResetCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11640,43 +23889,44 @@ type InstancesSetDiskAutoDeleteCall struct { project string zone string instance string - autoDelete bool - deviceName string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetDiskAutoDelete: Sets the auto-delete flag for a disk attached to // an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setDiskAutoDelete func (r *InstancesService) SetDiskAutoDelete(project string, zone string, instance string, autoDelete bool, deviceName string) *InstancesSetDiskAutoDeleteCall { - c := &InstancesSetDiskAutoDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesSetDiskAutoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance - c.autoDelete = autoDelete - c.deviceName = deviceName + c.urlParams_.Set("autoDelete", fmt.Sprint(autoDelete)) + c.urlParams_.Set("deviceName", deviceName) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesSetDiskAutoDeleteCall) Fields(s ...googleapi.Field) *InstancesSetDiskAutoDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesSetDiskAutoDeleteCall) Context(ctx context.Context) *InstancesSetDiskAutoDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetDiskAutoDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - params.Set("autoDelete", fmt.Sprintf("%v", c.autoDelete)) - params.Set("deviceName", fmt.Sprintf("%v", c.deviceName)) - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11684,7 +23934,30 @@ func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setDiskAutoDelete" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11692,7 +23965,12 @@ func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11759,19 +24037,20 @@ func (c *InstancesSetDiskAutoDeleteCall) Do() (*Operation, error) { // method id "compute.instances.setMetadata": type InstancesSetMetadataCall struct { - s *Service - project string - zone string - instance string - metadata *Metadata - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + metadata *Metadata + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetMetadata: Sets metadata for the specified instance to the data // included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setMetadata func (r *InstancesService) SetMetadata(project string, zone string, instance string, metadata *Metadata) *InstancesSetMetadataCall { - c := &InstancesSetMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesSetMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance @@ -11779,28 +24058,32 @@ func (r *InstancesService) SetMetadata(project string, zone string, instance str return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesSetMetadataCall) Fields(s ...googleapi.Field) *InstancesSetMetadataCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesSetMetadataCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesSetMetadataCall) Context(ctx context.Context) *InstancesSetMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetMetadataCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setMetadata") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11809,7 +24092,30 @@ func (c *InstancesSetMetadataCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setMetadata" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11817,7 +24123,12 @@ func (c *InstancesSetMetadataCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11877,13 +24188,14 @@ type InstancesSetSchedulingCall struct { zone string instance string scheduling *Scheduling - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetScheduling: Sets an instance's scheduling options. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setScheduling func (r *InstancesService) SetScheduling(project string, zone string, instance string, scheduling *Scheduling) *InstancesSetSchedulingCall { - c := &InstancesSetSchedulingCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesSetSchedulingCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance @@ -11891,28 +24203,32 @@ func (r *InstancesService) SetScheduling(project string, zone string, instance s return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesSetSchedulingCall) Fields(s ...googleapi.Field) *InstancesSetSchedulingCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesSetSchedulingCall) Context(ctx context.Context) *InstancesSetSchedulingCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetSchedulingCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.scheduling) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setScheduling") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -11921,7 +24237,30 @@ func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setScheduling" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -11929,7 +24268,12 @@ func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -11984,19 +24328,20 @@ func (c *InstancesSetSchedulingCall) Do() (*Operation, error) { // method id "compute.instances.setTags": type InstancesSetTagsCall struct { - s *Service - project string - zone string - instance string - tags *Tags - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + tags *Tags + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetTags: Sets tags for the specified instance to the data included in // the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/setTags func (r *InstancesService) SetTags(project string, zone string, instance string, tags *Tags) *InstancesSetTagsCall { - c := &InstancesSetTagsCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesSetTagsCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance @@ -12004,28 +24349,32 @@ func (r *InstancesService) SetTags(project string, zone string, instance string, return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesSetTagsCall) Fields(s ...googleapi.Field) *InstancesSetTagsCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesSetTagsCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesSetTagsCall) Context(ctx context.Context) *InstancesSetTagsCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesSetTagsCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.tags) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/setTags") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -12034,7 +24383,30 @@ func (c *InstancesSetTagsCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.setTags" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12042,7 +24414,12 @@ func (c *InstancesSetTagsCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12097,11 +24474,12 @@ func (c *InstancesSetTagsCall) Do() (*Operation, error) { // method id "compute.instances.start": type InstancesStartCall struct { - s *Service - project string - zone string - instance string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Start: This method starts an instance that was stopped using the @@ -12109,30 +24487,34 @@ type InstancesStartCall struct { // an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/start func (r *InstancesService) Start(project string, zone string, instance string) *InstancesStartCall { - c := &InstancesStartCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesStartCall) Fields(s ...googleapi.Field) *InstancesStartCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesStartCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesStartCall) Context(ctx context.Context) *InstancesStartCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStartCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/start") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -12140,7 +24522,30 @@ func (c *InstancesStartCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.start" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12148,7 +24553,12 @@ func (c *InstancesStartCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12200,11 +24610,12 @@ func (c *InstancesStartCall) Do() (*Operation, error) { // method id "compute.instances.stop": type InstancesStopCall struct { - s *Service - project string - zone string - instance string - opt_ map[string]interface{} + s *Service + project string + zone string + instance string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Stop: This method stops a running instance, shutting it down cleanly, @@ -12216,30 +24627,34 @@ type InstancesStopCall struct { // Stopping an instance. // For details, see https://cloud.google.com/compute/docs/reference/latest/instances/stop func (r *InstancesService) Stop(project string, zone string, instance string) *InstancesStopCall { - c := &InstancesStopCall{s: r.s, opt_: make(map[string]interface{})} + c := &InstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.instance = instance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *InstancesStopCall) Fields(s ...googleapi.Field) *InstancesStopCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *InstancesStopCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *InstancesStopCall) Context(ctx context.Context) *InstancesStopCall { + c.ctx_ = ctx + return c +} + +func (c *InstancesStopCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/instances/{instance}/stop") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -12247,7 +24662,30 @@ func (c *InstancesStopCall) Do() (*Operation, error) { "instance": c.instance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.instances.stop" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12255,7 +24693,12 @@ func (c *InstancesStopCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12307,45 +24750,87 @@ func (c *InstancesStopCall) Do() (*Operation, error) { // method id "compute.licenses.get": type LicensesGetCall struct { - s *Service - project string - license string - opt_ map[string]interface{} + s *Service + project string + license string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified license resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/licenses/get func (r *LicensesService) Get(project string, license string) *LicensesGetCall { - c := &LicensesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &LicensesGetCall{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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *LicensesGetCall) Fields(s ...googleapi.Field) *LicensesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *LicensesGetCall) Do() (*License, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *LicensesGetCall) Context(ctx context.Context) *LicensesGetCall { + c.ctx_ = ctx + return c +} + +func (c *LicensesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/licenses/{license}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "license": c.license, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.licenses.get" call. +// Exactly one of *License or error will be non-nil. 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() (*License, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12353,7 +24838,12 @@ func (c *LicensesGetCall) Do() (*License, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *License + ret := &License{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12398,74 +24888,121 @@ func (c *LicensesGetCall) Do() (*License, error) { // method id "compute.machineTypes.aggregatedList": type MachineTypesAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of machine type resources grouped // by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/aggregatedList func (r *MachineTypesService) AggregatedList(project string) *MachineTypesAggregatedListCall { - c := &MachineTypesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &MachineTypesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *MachineTypesAggregatedListCall) Filter(filter string) *MachineTypesAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *MachineTypesAggregatedListCall) MaxResults(maxResults int64) *MachineTypesAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *MachineTypesAggregatedListCall) PageToken(pageToken string) *MachineTypesAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *MachineTypesAggregatedListCall) Fields(s ...googleapi.Field) *MachineTypesAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *MachineTypesAggregatedListCall) Context(ctx context.Context) *MachineTypesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/machineTypes") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.aggregatedList" call. +// Exactly one of *MachineTypeAggregatedList or error will be non-nil. +// 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() (*MachineTypeAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12473,7 +25010,12 @@ func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *MachineTypeAggregatedList + ret := &MachineTypeAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12487,7 +25029,7 @@ func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -12501,7 +25043,7 @@ func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -12529,40 +25071,56 @@ func (c *MachineTypesAggregatedListCall) Do() (*MachineTypeAggregatedList, error // method id "compute.machineTypes.get": type MachineTypesGetCall struct { - s *Service - project string - zone string - machineType string - opt_ map[string]interface{} + s *Service + project string + zone string + machineType string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified machine type resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/get func (r *MachineTypesService) Get(project string, zone string, machineType string) *MachineTypesGetCall { - c := &MachineTypesGetCall{s: r.s, opt_: make(map[string]interface{})} + 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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *MachineTypesGetCall) Fields(s ...googleapi.Field) *MachineTypesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *MachineTypesGetCall) Do() (*MachineType, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *MachineTypesGetCall) Context(ctx context.Context) *MachineTypesGetCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes/{machineType}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -12570,7 +25128,33 @@ func (c *MachineTypesGetCall) Do() (*MachineType, error) { "machineType": c.machineType, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.get" call. +// Exactly one of *MachineType or error will be non-nil. 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 whether the returned error was because +// http.StatusNotModified was returned. +func (c *MachineTypesGetCall) Do() (*MachineType, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12578,7 +25162,12 @@ func (c *MachineTypesGetCall) Do() (*MachineType, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *MachineType + ret := &MachineType{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12631,77 +25220,124 @@ func (c *MachineTypesGetCall) Do() (*MachineType, error) { // method id "compute.machineTypes.list": type MachineTypesListCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of machine type resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/machineTypes/list func (r *MachineTypesService) List(project string, zone string) *MachineTypesListCall { - c := &MachineTypesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &MachineTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *MachineTypesListCall) Filter(filter string) *MachineTypesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *MachineTypesListCall) MaxResults(maxResults int64) *MachineTypesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *MachineTypesListCall) PageToken(pageToken string) *MachineTypesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *MachineTypesListCall) Fields(s ...googleapi.Field) *MachineTypesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *MachineTypesListCall) Context(ctx context.Context) *MachineTypesListCall { + c.ctx_ = ctx + return c +} + +func (c *MachineTypesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/machineTypes") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.machineTypes.list" call. +// Exactly one of *MachineTypeList or error will be non-nil. 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() (*MachineTypeList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12709,7 +25345,12 @@ func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *MachineTypeList + ret := &MachineTypeList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12724,7 +25365,7 @@ func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -12738,7 +25379,7 @@ func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -12773,45 +25414,73 @@ func (c *MachineTypesListCall) Do() (*MachineTypeList, error) { // method id "compute.networks.delete": type NetworksDeleteCall struct { - s *Service - project string - network string - opt_ map[string]interface{} + s *Service + project string + network string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified network resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/delete func (r *NetworksService) Delete(project string, network string) *NetworksDeleteCall { - c := &NetworksDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &NetworksDeleteCall{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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *NetworksDeleteCall) Fields(s ...googleapi.Field) *NetworksDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *NetworksDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *NetworksDeleteCall) Context(ctx context.Context) *NetworksDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "network": c.network, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.delete" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12819,7 +25488,12 @@ func (c *NetworksDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12863,45 +25537,87 @@ func (c *NetworksDeleteCall) Do() (*Operation, error) { // method id "compute.networks.get": type NetworksGetCall struct { - s *Service - project string - network string - opt_ map[string]interface{} + s *Service + project string + network string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified network resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/get func (r *NetworksService) Get(project string, network string) *NetworksGetCall { - c := &NetworksGetCall{s: r.s, opt_: make(map[string]interface{})} + 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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *NetworksGetCall) Fields(s ...googleapi.Field) *NetworksGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *NetworksGetCall) Do() (*Network, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *NetworksGetCall) Context(ctx context.Context) *NetworksGetCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks/{network}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "network": c.network, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.get" call. +// Exactly one of *Network or error will be non-nil. 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 error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *NetworksGetCall) Do() (*Network, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -12909,7 +25625,12 @@ func (c *NetworksGetCall) Do() (*Network, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Network + ret := &Network{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -12954,51 +25675,79 @@ func (c *NetworksGetCall) Do() (*Network, error) { // method id "compute.networks.insert": type NetworksInsertCall struct { - s *Service - project string - network *Network - opt_ map[string]interface{} + s *Service + project string + network *Network + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a network resource in the specified project using the // data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/insert func (r *NetworksService) Insert(project string, network *Network) *NetworksInsertCall { - c := &NetworksInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &NetworksInsertCall{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 +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *NetworksInsertCall) Fields(s ...googleapi.Field) *NetworksInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *NetworksInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *NetworksInsertCall) Context(ctx context.Context) *NetworksInsertCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.network) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.insert" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13006,7 +25755,12 @@ func (c *NetworksInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13045,74 +25799,121 @@ func (c *NetworksInsertCall) Do() (*Operation, error) { // method id "compute.networks.list": type NetworksListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of network resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/networks/list func (r *NetworksService) List(project string) *NetworksListCall { - c := &NetworksListCall{s: r.s, opt_: make(map[string]interface{})} + c := &NetworksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *NetworksListCall) Filter(filter string) *NetworksListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *NetworksListCall) MaxResults(maxResults int64) *NetworksListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *NetworksListCall) PageToken(pageToken string) *NetworksListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *NetworksListCall) Fields(s ...googleapi.Field) *NetworksListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *NetworksListCall) Do() (*NetworkList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *NetworksListCall) Context(ctx context.Context) *NetworksListCall { + c.ctx_ = ctx + return c +} + +func (c *NetworksListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/networks") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.networks.list" call. +// Exactly one of *NetworkList or error will be non-nil. 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 whether the returned error was because +// http.StatusNotModified was returned. +func (c *NetworksListCall) Do() (*NetworkList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13120,7 +25921,12 @@ func (c *NetworksListCall) Do() (*NetworkList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *NetworkList + ret := &NetworkList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13134,7 +25940,7 @@ func (c *NetworksListCall) Do() (*NetworkList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -13148,7 +25954,7 @@ func (c *NetworksListCall) Do() (*NetworkList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -13176,42 +25982,84 @@ func (c *NetworksListCall) Do() (*NetworkList, error) { // method id "compute.projects.get": type ProjectsGetCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified project resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/get func (r *ProjectsService) Get(project string) *ProjectsGetCall { - c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ProjectsGetCall) Do() (*Project, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +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. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.get" call. +// Exactly one of *Project or error will be non-nil. 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 *ProjectsGetCall) Do() (*Project, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13219,7 +26067,12 @@ func (c *ProjectsGetCall) Do() (*Project, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Project + ret := &Project{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13259,46 +26112,74 @@ type ProjectsMoveDiskCall struct { s *Service project string diskmoverequest *DiskMoveRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // MoveDisk: Moves a persistent disk from one zone to another. func (r *ProjectsService) MoveDisk(project string, diskmoverequest *DiskMoveRequest) *ProjectsMoveDiskCall { - c := &ProjectsMoveDiskCall{s: r.s, opt_: make(map[string]interface{})} + c := &ProjectsMoveDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.diskmoverequest = diskmoverequest return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ProjectsMoveDiskCall) Fields(s ...googleapi.Field) *ProjectsMoveDiskCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ProjectsMoveDiskCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsMoveDiskCall) Context(ctx context.Context) *ProjectsMoveDiskCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMoveDiskCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.diskmoverequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveDisk") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.moveDisk" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13306,7 +26187,12 @@ func (c *ProjectsMoveDiskCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13348,47 +26234,75 @@ type ProjectsMoveInstanceCall struct { s *Service project string instancemoverequest *InstanceMoveRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // MoveInstance: Moves an instance and its attached persistent disks // from one zone to another. func (r *ProjectsService) MoveInstance(project string, instancemoverequest *InstanceMoveRequest) *ProjectsMoveInstanceCall { - c := &ProjectsMoveInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c := &ProjectsMoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.instancemoverequest = instancemoverequest return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ProjectsMoveInstanceCall) Fields(s ...googleapi.Field) *ProjectsMoveInstanceCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ProjectsMoveInstanceCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsMoveInstanceCall) Context(ctx context.Context) *ProjectsMoveInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsMoveInstanceCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancemoverequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/moveInstance") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.moveInstance" call. +// Exactly one of *Operation or error will be non-nil. 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() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13396,7 +26310,12 @@ func (c *ProjectsMoveInstanceCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13435,51 +26354,79 @@ func (c *ProjectsMoveInstanceCall) Do() (*Operation, error) { // method id "compute.projects.setCommonInstanceMetadata": type ProjectsSetCommonInstanceMetadataCall struct { - s *Service - project string - metadata *Metadata - opt_ map[string]interface{} + s *Service + project string + metadata *Metadata + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetCommonInstanceMetadata: Sets metadata common to all instances // within the specified project using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata func (r *ProjectsService) SetCommonInstanceMetadata(project string, metadata *Metadata) *ProjectsSetCommonInstanceMetadataCall { - c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, opt_: make(map[string]interface{})} + c := &ProjectsSetCommonInstanceMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.metadata = metadata return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ProjectsSetCommonInstanceMetadataCall) Fields(s ...googleapi.Field) *ProjectsSetCommonInstanceMetadataCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsSetCommonInstanceMetadataCall) Context(ctx context.Context) *ProjectsSetCommonInstanceMetadataCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetCommonInstanceMetadataCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.metadata) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setCommonInstanceMetadata") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setCommonInstanceMetadata" call. +// Exactly one of *Operation or error will be non-nil. 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 *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13487,7 +26434,12 @@ func (c *ProjectsSetCommonInstanceMetadataCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13529,7 +26481,8 @@ type ProjectsSetUsageExportBucketCall struct { s *Service project string usageexportlocation *UsageExportLocation - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetUsageExportBucket: Enables the usage export feature and sets the @@ -13538,41 +26491,68 @@ type ProjectsSetUsageExportBucketCall struct { // disabled. // For details, see https://cloud.google.com/compute/docs/reference/latest/projects/setUsageExportBucket func (r *ProjectsService) SetUsageExportBucket(project string, usageexportlocation *UsageExportLocation) *ProjectsSetUsageExportBucketCall { - c := &ProjectsSetUsageExportBucketCall{s: r.s, opt_: make(map[string]interface{})} + c := &ProjectsSetUsageExportBucketCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.usageexportlocation = usageexportlocation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ProjectsSetUsageExportBucketCall) Fields(s ...googleapi.Field) *ProjectsSetUsageExportBucketCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ProjectsSetUsageExportBucketCall) Context(ctx context.Context) *ProjectsSetUsageExportBucketCall { + c.ctx_ = ctx + return c +} + +func (c *ProjectsSetUsageExportBucketCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.usageexportlocation) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/setUsageExportBucket") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.projects.setUsageExportBucket" call. +// Exactly one of *Operation or error will be non-nil. 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 *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13580,7 +26560,12 @@ func (c *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -13622,40 +26607,45 @@ func (c *ProjectsSetUsageExportBucketCall) Do() (*Operation, error) { // method id "compute.regionOperations.delete": type RegionOperationsDeleteCall struct { - s *Service - project string - region string - operation string - opt_ map[string]interface{} + s *Service + project string + region string + operation string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified region-specific operation resource. +// Delete: Deletes the specified region-specific Operations resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/delete func (r *RegionOperationsService) Delete(project string, region string, operation string) *RegionOperationsDeleteCall { - c := &RegionOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &RegionOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.operation = operation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RegionOperationsDeleteCall) Fields(s ...googleapi.Field) *RegionOperationsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RegionOperationsDeleteCall) Do() error { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionOperationsDeleteCall) Context(ctx context.Context) *RegionOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -13663,7 +26653,15 @@ func (c *RegionOperationsDeleteCall) Do() error { "operation": c.operation, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.delete" call. +func (c *RegionOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") if err != nil { return err } @@ -13673,7 +26671,7 @@ func (c *RegionOperationsDeleteCall) Do() error { } return nil // { - // "description": "Deletes the specified region-specific operation resource.", + // "description": "Deletes the specified region-specific Operations resource.", // "httpMethod": "DELETE", // "id": "compute.regionOperations.delete", // "parameterOrder": [ @@ -13683,7 +26681,7 @@ func (c *RegionOperationsDeleteCall) Do() error { // ], // "parameters": { // "operation": { - // "description": "Name of the operation resource to delete.", + // "description": "Name of the Operations resource to delete.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -13716,40 +26714,56 @@ func (c *RegionOperationsDeleteCall) Do() error { // method id "compute.regionOperations.get": type RegionOperationsGetCall struct { - s *Service - project string - region string - operation string - opt_ map[string]interface{} + s *Service + project string + region string + operation string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// Get: Retrieves the specified region-specific operation resource. +// Get: Retrieves the specified region-specific Operations resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/get func (r *RegionOperationsService) Get(project string, region string, operation string) *RegionOperationsGetCall { - c := &RegionOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &RegionOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.operation = operation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RegionOperationsGetCall) Fields(s ...googleapi.Field) *RegionOperationsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RegionOperationsGetCall) Do() (*Operation, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionOperationsGetCall) IfNoneMatch(entityTag string) *RegionOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionOperationsGetCall) Context(ctx context.Context) *RegionOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations/{operation}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -13757,7 +26771,33 @@ func (c *RegionOperationsGetCall) Do() (*Operation, error) { "operation": c.operation, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.get" call. +// Exactly one of *Operation or error will be non-nil. 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 *RegionOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13765,13 +26805,18 @@ func (c *RegionOperationsGetCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the specified region-specific operation resource.", + // "description": "Retrieves the specified region-specific Operations resource.", // "httpMethod": "GET", // "id": "compute.regionOperations.get", // "parameterOrder": [ @@ -13781,7 +26826,7 @@ func (c *RegionOperationsGetCall) Do() (*Operation, error) { // ], // "parameters": { // "operation": { - // "description": "Name of the operation resource to return.", + // "description": "Name of the Operations resource to return.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -13818,77 +26863,124 @@ func (c *RegionOperationsGetCall) Do() (*Operation, error) { // method id "compute.regionOperations.list": type RegionOperationsListCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// List: Retrieves the list of operation resources contained within the +// List: Retrieves the list of Operation resources contained within the // specified region. // For details, see https://cloud.google.com/compute/docs/reference/latest/regionOperations/list func (r *RegionOperationsService) List(project string, region string) *RegionOperationsListCall { - c := &RegionOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &RegionOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *RegionOperationsListCall) Filter(filter string) *RegionOperationsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *RegionOperationsListCall) MaxResults(maxResults int64) *RegionOperationsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *RegionOperationsListCall) PageToken(pageToken string) *RegionOperationsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RegionOperationsListCall) Fields(s ...googleapi.Field) *RegionOperationsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RegionOperationsListCall) Do() (*OperationList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionOperationsListCall) IfNoneMatch(entityTag string) *RegionOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionOperationsListCall) Context(ctx context.Context) *RegionOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionOperationsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/operations") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regionOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *RegionOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -13896,13 +26988,18 @@ func (c *RegionOperationsListCall) Do() (*OperationList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *OperationList + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the list of operation resources contained within the specified region.", + // "description": "Retrieves the list of Operation resources contained within the specified region.", // "httpMethod": "GET", // "id": "compute.regionOperations.list", // "parameterOrder": [ @@ -13911,7 +27008,7 @@ func (c *RegionOperationsListCall) Do() (*OperationList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -13925,7 +27022,7 @@ func (c *RegionOperationsListCall) Do() (*OperationList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -13960,45 +27057,87 @@ func (c *RegionOperationsListCall) Do() (*OperationList, error) { // method id "compute.regions.get": type RegionsGetCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified region resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/get func (r *RegionsService) Get(project string, region string) *RegionsGetCall { - c := &RegionsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &RegionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RegionsGetCall) Fields(s ...googleapi.Field) *RegionsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RegionsGetCall) Do() (*Region, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsGetCall) IfNoneMatch(entityTag string) *RegionsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionsGetCall) Context(ctx context.Context) *RegionsGetCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regions.get" call. +// Exactly one of *Region or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Region.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RegionsGetCall) Do() (*Region, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14006,7 +27145,12 @@ func (c *RegionsGetCall) Do() (*Region, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Region + ret := &Region{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14051,74 +27195,121 @@ func (c *RegionsGetCall) Do() (*Region, error) { // method id "compute.regions.list": type RegionsListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of region resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/regions/list func (r *RegionsService) List(project string) *RegionsListCall { - c := &RegionsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *RegionsListCall) Filter(filter string) *RegionsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *RegionsListCall) MaxResults(maxResults int64) *RegionsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *RegionsListCall) PageToken(pageToken string) *RegionsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RegionsListCall) Do() (*RegionList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall { + c.ctx_ = ctx + return c +} + +func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.regions.list" call. +// Exactly one of *RegionList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RegionList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RegionsListCall) Do() (*RegionList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14126,7 +27317,12 @@ func (c *RegionsListCall) Do() (*RegionList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *RegionList + ret := &RegionList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14140,7 +27336,7 @@ func (c *RegionsListCall) Do() (*RegionList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -14154,7 +27350,7 @@ func (c *RegionsListCall) Do() (*RegionList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -14182,45 +27378,73 @@ func (c *RegionsListCall) Do() (*RegionList, error) { // method id "compute.routes.delete": type RoutesDeleteCall struct { - s *Service - project string - route string - opt_ map[string]interface{} + s *Service + project string + route string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified route resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/delete func (r *RoutesService) Delete(project string, route string) *RoutesDeleteCall { - c := &RoutesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &RoutesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.route = route return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RoutesDeleteCall) Fields(s ...googleapi.Field) *RoutesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RoutesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RoutesDeleteCall) Context(ctx context.Context) *RoutesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "route": c.route, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *RoutesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14228,7 +27452,12 @@ func (c *RoutesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14272,45 +27501,87 @@ func (c *RoutesDeleteCall) Do() (*Operation, error) { // method id "compute.routes.get": type RoutesGetCall struct { - s *Service - project string - route string - opt_ map[string]interface{} + s *Service + project string + route string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified route resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/get func (r *RoutesService) Get(project string, route string) *RoutesGetCall { - c := &RoutesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &RoutesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.route = route return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RoutesGetCall) Fields(s ...googleapi.Field) *RoutesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RoutesGetCall) Do() (*Route, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoutesGetCall) IfNoneMatch(entityTag string) *RoutesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RoutesGetCall) Context(ctx context.Context) *RoutesGetCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes/{route}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "route": c.route, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.get" call. +// Exactly one of *Route or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Route.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *RoutesGetCall) Do() (*Route, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14318,7 +27589,12 @@ func (c *RoutesGetCall) Do() (*Route, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Route + ret := &Route{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14363,51 +27639,79 @@ func (c *RoutesGetCall) Do() (*Route, error) { // method id "compute.routes.insert": type RoutesInsertCall struct { - s *Service - project string - route *Route - opt_ map[string]interface{} + s *Service + project string + route *Route + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a route resource in the specified project using the // data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/insert func (r *RoutesService) Insert(project string, route *Route) *RoutesInsertCall { - c := &RoutesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &RoutesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.route = route return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RoutesInsertCall) Fields(s ...googleapi.Field) *RoutesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RoutesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RoutesInsertCall) Context(ctx context.Context) *RoutesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.route) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *RoutesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14415,7 +27719,12 @@ func (c *RoutesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14454,74 +27763,121 @@ func (c *RoutesInsertCall) Do() (*Operation, error) { // method id "compute.routes.list": type RoutesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of route resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/routes/list func (r *RoutesService) List(project string) *RoutesListCall { - c := &RoutesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &RoutesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *RoutesListCall) Filter(filter string) *RoutesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *RoutesListCall) MaxResults(maxResults int64) *RoutesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *RoutesListCall) PageToken(pageToken string) *RoutesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *RoutesListCall) Fields(s ...googleapi.Field) *RoutesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *RoutesListCall) Do() (*RouteList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *RoutesListCall) IfNoneMatch(entityTag string) *RoutesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *RoutesListCall) Context(ctx context.Context) *RoutesListCall { + c.ctx_ = ctx + return c +} + +func (c *RoutesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/routes") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.routes.list" call. +// Exactly one of *RouteList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *RouteList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *RoutesListCall) Do() (*RouteList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14529,7 +27885,12 @@ func (c *RoutesListCall) Do() (*RouteList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *RouteList + ret := &RouteList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14543,7 +27904,7 @@ func (c *RoutesListCall) Do() (*RouteList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -14557,7 +27918,7 @@ func (c *RoutesListCall) Do() (*RouteList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -14585,45 +27946,79 @@ func (c *RoutesListCall) Do() (*RouteList, error) { // method id "compute.snapshots.delete": type SnapshotsDeleteCall struct { - s *Service - project string - snapshot string - opt_ map[string]interface{} + s *Service + project string + snapshot string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified persistent disk snapshot resource. +// Delete: Deletes the specified Snapshot resource. Keep in mind that +// deleting a single snapshot might not necessarily delete all the data +// on that snapshot. If any data on the snapshot that is marked for +// deletion is needed for subsequent snapshots, the data will be moved +// to the next corresponding snapshot. +// +// For more information, see Deleting snaphots. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/delete func (r *SnapshotsService) Delete(project string, snapshot string) *SnapshotsDeleteCall { - c := &SnapshotsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &SnapshotsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.snapshot = snapshot return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SnapshotsDeleteCall) Fields(s ...googleapi.Field) *SnapshotsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *SnapshotsDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SnapshotsDeleteCall) Context(ctx context.Context) *SnapshotsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "snapshot": c.snapshot, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *SnapshotsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14631,13 +28026,18 @@ func (c *SnapshotsDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Deletes the specified persistent disk snapshot resource.", + // "description": "Deletes the specified Snapshot resource. Keep in mind that deleting a single snapshot might not necessarily delete all the data on that snapshot. If any data on the snapshot that is marked for deletion is needed for subsequent snapshots, the data will be moved to the next corresponding snapshot.\n\nFor more information, see Deleting snaphots.", // "httpMethod": "DELETE", // "id": "compute.snapshots.delete", // "parameterOrder": [ @@ -14653,7 +28053,7 @@ func (c *SnapshotsDeleteCall) Do() (*Operation, error) { // "type": "string" // }, // "snapshot": { - // "description": "Name of the persistent disk snapshot resource to delete.", + // "description": "Name of the Snapshot resource to delete.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -14675,45 +28075,87 @@ func (c *SnapshotsDeleteCall) Do() (*Operation, error) { // method id "compute.snapshots.get": type SnapshotsGetCall struct { - s *Service - project string - snapshot string - opt_ map[string]interface{} + s *Service + project string + snapshot string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// Get: Returns the specified persistent disk snapshot resource. +// Get: Returns the specified Snapshot resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/get func (r *SnapshotsService) Get(project string, snapshot string) *SnapshotsGetCall { - c := &SnapshotsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.snapshot = snapshot return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *SnapshotsGetCall) Do() (*Snapshot, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots/{snapshot}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "snapshot": c.snapshot, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.get" call. +// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Snapshot.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsGetCall) Do() (*Snapshot, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14721,13 +28163,18 @@ func (c *SnapshotsGetCall) Do() (*Snapshot, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Snapshot + ret := &Snapshot{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Returns the specified persistent disk snapshot resource.", + // "description": "Returns the specified Snapshot resource.", // "httpMethod": "GET", // "id": "compute.snapshots.get", // "parameterOrder": [ @@ -14743,7 +28190,7 @@ func (c *SnapshotsGetCall) Do() (*Snapshot, error) { // "type": "string" // }, // "snapshot": { - // "description": "Name of the persistent disk snapshot resource to return.", + // "description": "Name of the Snapshot resource to return.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -14766,74 +28213,121 @@ func (c *SnapshotsGetCall) Do() (*Snapshot, error) { // method id "compute.snapshots.list": type SnapshotsListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// List: Retrieves the list of persistent disk snapshot resources -// contained within the specified project. +// List: Retrieves the list of Snapshot resources contained within the +// specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/snapshots/list func (r *SnapshotsService) List(project string) *SnapshotsListCall { - c := &SnapshotsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *SnapshotsListCall) Filter(filter string) *SnapshotsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *SnapshotsListCall) Do() (*SnapshotList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall { + c.ctx_ = ctx + return c +} + +func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/snapshots") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.snapshots.list" call. +// Exactly one of *SnapshotList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SnapshotList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *SnapshotsListCall) Do() (*SnapshotList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14841,13 +28335,18 @@ func (c *SnapshotsListCall) Do() (*SnapshotList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *SnapshotList + ret := &SnapshotList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the list of persistent disk snapshot resources contained within the specified project.", + // "description": "Retrieves the list of Snapshot resources contained within the specified project.", // "httpMethod": "GET", // "id": "compute.snapshots.list", // "parameterOrder": [ @@ -14855,7 +28354,7 @@ func (c *SnapshotsListCall) Do() (*SnapshotList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -14869,7 +28368,7 @@ func (c *SnapshotsListCall) Do() (*SnapshotList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -14894,48 +28393,75 @@ func (c *SnapshotsListCall) Do() (*SnapshotList, error) { } -// method id "compute.targetHttpProxies.delete": +// method id "compute.sslCertificates.delete": -type TargetHttpProxiesDeleteCall struct { - s *Service - project string - targetHttpProxy string - opt_ map[string]interface{} +type SslCertificatesDeleteCall struct { + s *Service + project string + sslCertificate string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified TargetHttpProxy resource. -// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete -func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall { - c := &TargetHttpProxiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} +// Delete: Deletes the specified SslCertificate resource. +func (r *SslCertificatesService) Delete(project string, sslCertificate string) *SslCertificatesDeleteCall { + c := &SslCertificatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project - c.targetHttpProxy = targetHttpProxy + c.sslCertificate = sslCertificate return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) +func (c *SslCertificatesDeleteCall) Fields(s ...googleapi.Field) *SslCertificatesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetHttpProxiesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SslCertificatesDeleteCall) Context(ctx context.Context) *SslCertificatesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") - urls += "?" + params.Encode() + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}") + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ - "project": c.project, - "targetHttpProxy": c.targetHttpProxy, + "project": c.project, + "sslCertificate": c.sslCertificate, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *SslCertificatesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -14943,7 +28469,577 @@ func (c *TargetHttpProxiesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Deletes the specified SslCertificate resource.", + // "httpMethod": "DELETE", + // "id": "compute.sslCertificates.delete", + // "parameterOrder": [ + // "project", + // "sslCertificate" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "sslCertificate": { + // "description": "Name of the SslCertificate resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates/{sslCertificate}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.sslCertificates.get": + +type SslCertificatesGetCall struct { + s *Service + project string + sslCertificate string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// Get: Returns the specified SslCertificate resource. +func (r *SslCertificatesService) Get(project string, sslCertificate string) *SslCertificatesGetCall { + c := &SslCertificatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.sslCertificate = sslCertificate + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesGetCall) Fields(s ...googleapi.Field) *SslCertificatesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertificatesGetCall) IfNoneMatch(entityTag string) *SslCertificatesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SslCertificatesGetCall) Context(ctx context.Context) *SslCertificatesGetCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates/{sslCertificate}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "sslCertificate": c.sslCertificate, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.get" call. +// Exactly one of *SslCertificate or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *SslCertificate.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertificatesGetCall) Do() (*SslCertificate, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &SslCertificate{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified SslCertificate resource.", + // "httpMethod": "GET", + // "id": "compute.sslCertificates.get", + // "parameterOrder": [ + // "project", + // "sslCertificate" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "sslCertificate": { + // "description": "Name of the SslCertificate resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates/{sslCertificate}", + // "response": { + // "$ref": "SslCertificate" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.sslCertificates.insert": + +type SslCertificatesInsertCall struct { + s *Service + project string + sslcertificate *SslCertificate + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Insert: Creates a SslCertificate resource in the specified project +// using the data included in the request. +func (r *SslCertificatesService) Insert(project string, sslcertificate *SslCertificate) *SslCertificatesInsertCall { + c := &SslCertificatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.sslcertificate = sslcertificate + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesInsertCall) Fields(s ...googleapi.Field) *SslCertificatesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SslCertificatesInsertCall) Context(ctx context.Context) *SslCertificatesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.sslcertificate) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *SslCertificatesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a SslCertificate resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.sslCertificates.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates", + // "request": { + // "$ref": "SslCertificate" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.sslCertificates.list": + +type SslCertificatesListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// List: Retrieves the list of SslCertificate resources available to the +// specified project. +func (r *SslCertificatesService) List(project string) *SslCertificatesListCall { + c := &SslCertificatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *SslCertificatesListCall) Filter(filter string) *SslCertificatesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *SslCertificatesListCall) MaxResults(maxResults int64) *SslCertificatesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *SslCertificatesListCall) PageToken(pageToken string) *SslCertificatesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *SslCertificatesListCall) Fields(s ...googleapi.Field) *SslCertificatesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *SslCertificatesListCall) IfNoneMatch(entityTag string) *SslCertificatesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *SslCertificatesListCall) Context(ctx context.Context) *SslCertificatesListCall { + c.ctx_ = ctx + return c +} + +func (c *SslCertificatesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/sslCertificates") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.sslCertificates.list" call. +// Exactly one of *SslCertificateList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *SslCertificateList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *SslCertificatesListCall) Do() (*SslCertificateList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &SslCertificateList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of SslCertificate resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.sslCertificates.list", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/sslCertificates", + // "response": { + // "$ref": "SslCertificateList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpProxies.delete": + +type TargetHttpProxiesDeleteCall struct { + s *Service + project string + targetHttpProxy string + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Delete: Deletes the specified TargetHttpProxy resource. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/delete +func (r *TargetHttpProxiesService) Delete(project string, targetHttpProxy string) *TargetHttpProxiesDeleteCall { + c := &TargetHttpProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.targetHttpProxy = targetHttpProxy + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpProxiesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpProxiesDeleteCall) Context(ctx context.Context) *TargetHttpProxiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpProxy": c.targetHttpProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpProxiesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -14990,42 +29086,84 @@ type TargetHttpProxiesGetCall struct { s *Service project string targetHttpProxy string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified TargetHttpProxy resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/get func (r *TargetHttpProxiesService) Get(project string, targetHttpProxy string) *TargetHttpProxiesGetCall { - c := &TargetHttpProxiesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetHttpProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.targetHttpProxy = targetHttpProxy return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetHttpProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpProxiesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetHttpProxiesGetCall) Do() (*TargetHttpProxy, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpProxiesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpProxiesGetCall) Context(ctx context.Context) *TargetHttpProxiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies/{targetHttpProxy}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "targetHttpProxy": c.targetHttpProxy, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.get" call. +// Exactly one of *TargetHttpProxy or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetHttpProxy.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpProxiesGetCall) Do() (*TargetHttpProxy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15033,7 +29171,12 @@ func (c *TargetHttpProxiesGetCall) Do() (*TargetHttpProxy, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetHttpProxy + ret := &TargetHttpProxy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15081,48 +29224,76 @@ type TargetHttpProxiesInsertCall struct { s *Service project string targethttpproxy *TargetHttpProxy - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a TargetHttpProxy resource in the specified project // using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/insert func (r *TargetHttpProxiesService) Insert(project string, targethttpproxy *TargetHttpProxy) *TargetHttpProxiesInsertCall { - c := &TargetHttpProxiesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetHttpProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.targethttpproxy = targethttpproxy return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetHttpProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpProxiesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetHttpProxiesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpProxiesInsertCall) Context(ctx context.Context) *TargetHttpProxiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpproxy) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpProxiesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15130,7 +29301,12 @@ func (c *TargetHttpProxiesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15169,74 +29345,121 @@ func (c *TargetHttpProxiesInsertCall) Do() (*Operation, error) { // method id "compute.targetHttpProxies.list": type TargetHttpProxiesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of TargetHttpProxy resources available to // the specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/list func (r *TargetHttpProxiesService) List(project string) *TargetHttpProxiesListCall { - c := &TargetHttpProxiesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetHttpProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *TargetHttpProxiesListCall) Filter(filter string) *TargetHttpProxiesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *TargetHttpProxiesListCall) MaxResults(maxResults int64) *TargetHttpProxiesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *TargetHttpProxiesListCall) PageToken(pageToken string) *TargetHttpProxiesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetHttpProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpProxiesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpProxiesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpProxiesListCall) Context(ctx context.Context) *TargetHttpProxiesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpProxies") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.list" call. +// Exactly one of *TargetHttpProxyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpProxyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15244,7 +29467,12 @@ func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetHttpProxyList + ret := &TargetHttpProxyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15258,7 +29486,7 @@ func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -15272,7 +29500,7 @@ func (c *TargetHttpProxiesListCall) Do() (*TargetHttpProxyList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -15304,41 +29532,46 @@ type TargetHttpProxiesSetUrlMapCall struct { project string targetHttpProxy string urlmapreference *UrlMapReference - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetUrlMap: Changes the URL map for TargetHttpProxy. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetHttpProxies/setUrlMap func (r *TargetHttpProxiesService) SetUrlMap(project string, targetHttpProxy string, urlmapreference *UrlMapReference) *TargetHttpProxiesSetUrlMapCall { - c := &TargetHttpProxiesSetUrlMapCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetHttpProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.targetHttpProxy = targetHttpProxy c.urlmapreference = urlmapreference return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetHttpProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpProxiesSetUrlMapCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpProxiesSetUrlMapCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -15346,7 +29579,30 @@ func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpProxies.setUrlMap" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15354,7 +29610,12 @@ func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15398,77 +29659,75 @@ func (c *TargetHttpProxiesSetUrlMapCall) Do() (*Operation, error) { } -// method id "compute.targetInstances.aggregatedList": +// method id "compute.targetHttpsProxies.delete": -type TargetInstancesAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} +type TargetHttpsProxiesDeleteCall struct { + s *Service + project string + targetHttpsProxy string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// AggregatedList: Retrieves the list of target instances grouped by -// scope. -// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList -func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall { - c := &TargetInstancesAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} +// Delete: Deletes the specified TargetHttpsProxy resource. +func (r *TargetHttpsProxiesService) Delete(project string, targetHttpsProxy string) *TargetHttpsProxiesDeleteCall { + c := &TargetHttpsProxiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project + c.targetHttpsProxy = targetHttpsProxy return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. -func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall { - c.opt_["filter"] = filter - return c -} - -// MaxResults sets the optional parameter "maxResults": Maximum count of -// results to be returned. -func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall { - c.opt_["maxResults"] = maxResults - return c -} - -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. -func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall { - c.opt_["pageToken"] = pageToken - return c -} - -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. -func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) +func (c *TargetHttpsProxiesDeleteCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesDeleteCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpsProxiesDeleteCall) Context(ctx context.Context) *TargetHttpsProxiesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } - urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances") - urls += "?" + params.Encode() - req, _ := http.NewRequest("GET", urls, body) + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ - "project": c.project, + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpsProxiesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15476,21 +29735,456 @@ func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetInstanceAggregatedList + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the list of target instances grouped by scope.", + // "description": "Deletes the specified TargetHttpsProxy resource.", + // "httpMethod": "DELETE", + // "id": "compute.targetHttpsProxies.delete", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource to delete.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.get": + +type TargetHttpsProxiesGetCall struct { + s *Service + project string + targetHttpsProxy string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// Get: Returns the specified TargetHttpsProxy resource. +func (r *TargetHttpsProxiesService) Get(project string, targetHttpsProxy string) *TargetHttpsProxiesGetCall { + c := &TargetHttpsProxiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesGetCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesGetCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpsProxiesGetCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpsProxiesGetCall) Context(ctx context.Context) *TargetHttpsProxiesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesGetCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies/{targetHttpsProxy}") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.get" call. +// Exactly one of *TargetHttpsProxy or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpsProxy.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpsProxiesGetCall) Do() (*TargetHttpsProxy, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &TargetHttpsProxy{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Returns the specified TargetHttpsProxy resource.", // "httpMethod": "GET", - // "id": "compute.targetInstances.aggregatedList", + // "id": "compute.targetHttpsProxies.get", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource to return.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies/{targetHttpsProxy}", + // "response": { + // "$ref": "TargetHttpsProxy" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.insert": + +type TargetHttpsProxiesInsertCall struct { + s *Service + project string + targethttpsproxy *TargetHttpsProxy + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// Insert: Creates a TargetHttpsProxy resource in the specified project +// using the data included in the request. +func (r *TargetHttpsProxiesService) Insert(project string, targethttpsproxy *TargetHttpsProxy) *TargetHttpsProxiesInsertCall { + c := &TargetHttpsProxiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.targethttpsproxy = targethttpsproxy + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesInsertCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesInsertCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpsProxiesInsertCall) Context(ctx context.Context) *TargetHttpsProxiesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesInsertCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxy) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpsProxiesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Creates a TargetHttpsProxy resource in the specified project using the data included in the request.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.insert", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies", + // "request": { + // "$ref": "TargetHttpsProxy" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.list": + +type TargetHttpsProxiesListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// List: Retrieves the list of TargetHttpsProxy resources available to +// the specified project. +func (r *TargetHttpsProxiesService) List(project string) *TargetHttpsProxiesListCall { + c := &TargetHttpsProxiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetHttpsProxiesListCall) Filter(filter string) *TargetHttpsProxiesListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetHttpsProxiesListCall) MaxResults(maxResults int64) *TargetHttpsProxiesListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetHttpsProxiesListCall) PageToken(pageToken string) *TargetHttpsProxiesListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesListCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetHttpsProxiesListCall) IfNoneMatch(entityTag string) *TargetHttpsProxiesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpsProxiesListCall) Context(ctx context.Context) *TargetHttpsProxiesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/targetHttpsProxies") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.list" call. +// Exactly one of *TargetHttpsProxyList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetHttpsProxyList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetHttpsProxiesListCall) Do() (*TargetHttpsProxyList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &TargetHttpsProxyList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of TargetHttpsProxy resources available to the specified project.", + // "httpMethod": "GET", + // "id": "compute.targetHttpsProxies.list", // "parameterOrder": [ // "project" // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -15504,7 +30198,456 @@ func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", + // "location": "query", + // "type": "string" + // }, + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/global/targetHttpsProxies", + // "response": { + // "$ref": "TargetHttpsProxyList" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute", + // "https://www.googleapis.com/auth/compute.readonly" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.setSslCertificates": + +type TargetHttpsProxiesSetSslCertificatesCall struct { + s *Service + project string + targetHttpsProxy string + targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// SetSslCertificates: Replaces SslCertificates for TargetHttpsProxy. +func (r *TargetHttpsProxiesService) SetSslCertificates(project string, targetHttpsProxy string, targethttpsproxiessetsslcertificatesrequest *TargetHttpsProxiesSetSslCertificatesRequest) *TargetHttpsProxiesSetSslCertificatesCall { + c := &TargetHttpsProxiesSetSslCertificatesCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + c.targethttpsproxiessetsslcertificatesrequest = targethttpsproxiessetsslcertificatesrequest + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetSslCertificatesCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpsProxiesSetSslCertificatesCall) Context(ctx context.Context) *TargetHttpsProxiesSetSslCertificatesCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesSetSslCertificatesCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.targethttpsproxiessetsslcertificatesrequest) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.setSslCertificates" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpsProxiesSetSslCertificatesCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Replaces SslCertificates for TargetHttpsProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.setSslCertificates", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates", + // "request": { + // "$ref": "TargetHttpsProxiesSetSslCertificatesRequest" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetHttpsProxies.setUrlMap": + +type TargetHttpsProxiesSetUrlMapCall struct { + s *Service + project string + targetHttpsProxy string + urlmapreference *UrlMapReference + urlParams_ gensupport.URLParams + ctx_ context.Context +} + +// SetUrlMap: Changes the URL map for TargetHttpsProxy. +func (r *TargetHttpsProxiesService) SetUrlMap(project string, targetHttpsProxy string, urlmapreference *UrlMapReference) *TargetHttpsProxiesSetUrlMapCall { + c := &TargetHttpsProxiesSetUrlMapCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + c.targetHttpsProxy = targetHttpsProxy + c.urlmapreference = urlmapreference + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetHttpsProxiesSetUrlMapCall) Fields(s ...googleapi.Field) *TargetHttpsProxiesSetUrlMapCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetHttpsProxiesSetUrlMapCall) Context(ctx context.Context) *TargetHttpsProxiesSetUrlMapCall { + c.ctx_ = ctx + return c +} + +func (c *TargetHttpsProxiesSetUrlMapCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapreference) + if err != nil { + return nil, err + } + ctype := "application/json" + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("POST", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + "targetHttpsProxy": c.targetHttpsProxy, + }) + req.Header.Set("Content-Type", ctype) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetHttpsProxies.setUrlMap" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetHttpsProxiesSetUrlMapCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Changes the URL map for TargetHttpsProxy.", + // "httpMethod": "POST", + // "id": "compute.targetHttpsProxies.setUrlMap", + // "parameterOrder": [ + // "project", + // "targetHttpsProxy" + // ], + // "parameters": { + // "project": { + // "description": "Name of the project scoping 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-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", + // "required": true, + // "type": "string" + // }, + // "targetHttpsProxy": { + // "description": "Name of the TargetHttpsProxy resource whose URL map is to be set.", + // "location": "path", + // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", + // "required": true, + // "type": "string" + // } + // }, + // "path": "{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap", + // "request": { + // "$ref": "UrlMapReference" + // }, + // "response": { + // "$ref": "Operation" + // }, + // "scopes": [ + // "https://www.googleapis.com/auth/cloud-platform", + // "https://www.googleapis.com/auth/compute" + // ] + // } + +} + +// method id "compute.targetInstances.aggregatedList": + +type TargetInstancesAggregatedListCall struct { + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context +} + +// AggregatedList: Retrieves the list of target instances grouped by +// scope. +// For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/aggregatedList +func (r *TargetInstancesService) AggregatedList(project string) *TargetInstancesAggregatedListCall { + c := &TargetInstancesAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.project = project + return c +} + +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. +func (c *TargetInstancesAggregatedListCall) Filter(filter string) *TargetInstancesAggregatedListCall { + c.urlParams_.Set("filter", filter) + return c +} + +// MaxResults sets the optional parameter "maxResults": Maximum count of +// results to be returned. +func (c *TargetInstancesAggregatedListCall) MaxResults(maxResults int64) *TargetInstancesAggregatedListCall { + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) + return c +} + +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. +func (c *TargetInstancesAggregatedListCall) PageToken(pageToken string) *TargetInstancesAggregatedListCall { + c.urlParams_.Set("pageToken", pageToken) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// for more information. +func (c *TargetInstancesAggregatedListCall) Fields(s ...googleapi.Field) *TargetInstancesAggregatedListCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesAggregatedListCall) IfNoneMatch(entityTag string) *TargetInstancesAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetInstancesAggregatedListCall) Context(ctx context.Context) *TargetInstancesAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesAggregatedListCall) doRequest(alt string) (*http.Response, error) { + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetInstances") + urls += "?" + c.urlParams_.Encode() + req, _ := http.NewRequest("GET", urls, body) + googleapi.Expand(req.URL, map[string]string{ + "project": c.project, + }) + req.Header.Set("User-Agent", c.s.userAgent()) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.aggregatedList" call. +// Exactly one of *TargetInstanceAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *TargetInstanceAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesAggregatedListCall) Do() (*TargetInstanceAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &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, err + } + ret := &TargetInstanceAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { + return nil, err + } + return ret, nil + // { + // "description": "Retrieves the list of target instances grouped by scope.", + // "httpMethod": "GET", + // "id": "compute.targetInstances.aggregatedList", + // "parameterOrder": [ + // "project" + // ], + // "parameters": { + // "filter": { + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", + // "location": "query", + // "type": "string" + // }, + // "maxResults": { + // "default": "500", + // "description": "Maximum count of results to be returned.", + // "format": "uint32", + // "location": "query", + // "maximum": "500", + // "minimum": "0", + // "type": "integer" + // }, + // "pageToken": { + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -15536,36 +30679,41 @@ type TargetInstancesDeleteCall struct { project string zone string targetInstance string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified TargetInstance resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/delete func (r *TargetInstancesService) Delete(project string, zone string, targetInstance string) *TargetInstancesDeleteCall { - c := &TargetInstancesDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.targetInstance = targetInstance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetInstancesDeleteCall) Fields(s ...googleapi.Field) *TargetInstancesDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetInstancesDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetInstancesDeleteCall) Context(ctx context.Context) *TargetInstancesDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -15573,7 +30721,30 @@ func (c *TargetInstancesDeleteCall) Do() (*Operation, error) { "targetInstance": c.targetInstance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetInstancesDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15581,7 +30752,12 @@ func (c *TargetInstancesDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15637,36 +30813,52 @@ type TargetInstancesGetCall struct { project string zone string targetInstance string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified TargetInstance resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/get func (r *TargetInstancesService) Get(project string, zone string, targetInstance string) *TargetInstancesGetCall { - c := &TargetInstancesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.targetInstance = targetInstance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetInstancesGetCall) Fields(s ...googleapi.Field) *TargetInstancesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesGetCall) IfNoneMatch(entityTag string) *TargetInstancesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetInstancesGetCall) Context(ctx context.Context) *TargetInstancesGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances/{targetInstance}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -15674,7 +30866,33 @@ func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { "targetInstance": c.targetInstance, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.get" call. +// Exactly one of *TargetInstance or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetInstance.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15682,7 +30900,12 @@ func (c *TargetInstancesGetCall) Do() (*TargetInstance, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetInstance + ret := &TargetInstance{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15739,42 +30962,47 @@ type TargetInstancesInsertCall struct { project string zone string targetinstance *TargetInstance - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a TargetInstance resource in the specified project // and zone using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/insert func (r *TargetInstancesService) Insert(project string, zone string, targetinstance *TargetInstance) *TargetInstancesInsertCall { - c := &TargetInstancesInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetInstancesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.targetinstance = targetinstance return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetInstancesInsertCall) Fields(s ...googleapi.Field) *TargetInstancesInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetInstancesInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetInstancesInsertCall) Context(ctx context.Context) *TargetInstancesInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetinstance) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -15782,7 +31010,30 @@ func (c *TargetInstancesInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetInstancesInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15790,7 +31041,12 @@ func (c *TargetInstancesInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15837,77 +31093,124 @@ func (c *TargetInstancesInsertCall) Do() (*Operation, error) { // method id "compute.targetInstances.list": type TargetInstancesListCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of TargetInstance resources available to the // specified project and zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetInstances/list func (r *TargetInstancesService) List(project string, zone string) *TargetInstancesListCall { - c := &TargetInstancesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *TargetInstancesListCall) Filter(filter string) *TargetInstancesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *TargetInstancesListCall) MaxResults(maxResults int64) *TargetInstancesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *TargetInstancesListCall) PageToken(pageToken string) *TargetInstancesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetInstancesListCall) Fields(s ...googleapi.Field) *TargetInstancesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetInstancesListCall) IfNoneMatch(entityTag string) *TargetInstancesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetInstancesListCall) Context(ctx context.Context) *TargetInstancesListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetInstancesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/targetInstances") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetInstances.list" call. +// Exactly one of *TargetInstanceList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetInstanceList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -15915,7 +31218,12 @@ func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetInstanceList + ret := &TargetInstanceList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -15930,7 +31238,7 @@ func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -15944,7 +31252,7 @@ func (c *TargetInstancesListCall) Do() (*TargetInstanceList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -15984,13 +31292,14 @@ type TargetPoolsAddHealthCheckCall struct { region string targetPool string targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // AddHealthCheck: Adds health check URL to targetPool. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addHealthCheck func (r *TargetPoolsService) AddHealthCheck(project string, region string, targetPool string, targetpoolsaddhealthcheckrequest *TargetPoolsAddHealthCheckRequest) *TargetPoolsAddHealthCheckCall { - c := &TargetPoolsAddHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsAddHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool @@ -15998,28 +31307,32 @@ func (r *TargetPoolsService) AddHealthCheck(project string, region string, targe return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsAddHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsAddHealthCheckCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsAddHealthCheckCall) Context(ctx context.Context) *TargetPoolsAddHealthCheckCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAddHealthCheckCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddhealthcheckrequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16028,7 +31341,30 @@ func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.addHealthCheck" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16036,7 +31372,12 @@ func (c *TargetPoolsAddHealthCheckCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16095,13 +31436,14 @@ type TargetPoolsAddInstanceCall struct { region string targetPool string targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // AddInstance: Adds instance url to targetPool. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/addInstance func (r *TargetPoolsService) AddInstance(project string, region string, targetPool string, targetpoolsaddinstancerequest *TargetPoolsAddInstanceRequest) *TargetPoolsAddInstanceCall { - c := &TargetPoolsAddInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsAddInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool @@ -16109,28 +31451,32 @@ func (r *TargetPoolsService) AddInstance(project string, region string, targetPo return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsAddInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsAddInstanceCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsAddInstanceCall) Context(ctx context.Context) *TargetPoolsAddInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAddInstanceCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsaddinstancerequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/addInstance") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16139,7 +31485,30 @@ func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.addInstance" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsAddInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16147,7 +31516,12 @@ func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16201,73 +31575,120 @@ func (c *TargetPoolsAddInstanceCall) Do() (*Operation, error) { // method id "compute.targetPools.aggregatedList": type TargetPoolsAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of target pools grouped by scope. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/aggregatedList func (r *TargetPoolsService) AggregatedList(project string) *TargetPoolsAggregatedListCall { - c := &TargetPoolsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *TargetPoolsAggregatedListCall) Filter(filter string) *TargetPoolsAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *TargetPoolsAggregatedListCall) MaxResults(maxResults int64) *TargetPoolsAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *TargetPoolsAggregatedListCall) PageToken(pageToken string) *TargetPoolsAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsAggregatedListCall) Fields(s ...googleapi.Field) *TargetPoolsAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsAggregatedListCall) IfNoneMatch(entityTag string) *TargetPoolsAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsAggregatedListCall) Context(ctx context.Context) *TargetPoolsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetPools") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.aggregatedList" call. +// Exactly one of *TargetPoolAggregatedList or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetPoolAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16275,7 +31696,12 @@ func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetPoolAggregatedList + ret := &TargetPoolAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16289,7 +31715,7 @@ func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -16303,7 +31729,7 @@ func (c *TargetPoolsAggregatedListCall) Do() (*TargetPoolAggregatedList, error) // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -16335,36 +31761,41 @@ type TargetPoolsDeleteCall struct { project string region string targetPool string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified TargetPool resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/delete func (r *TargetPoolsService) Delete(project string, region string, targetPool string) *TargetPoolsDeleteCall { - c := &TargetPoolsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsDeleteCall) Fields(s ...googleapi.Field) *TargetPoolsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsDeleteCall) Context(ctx context.Context) *TargetPoolsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16372,7 +31803,30 @@ func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { "targetPool": c.targetPool, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16380,7 +31834,12 @@ func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16432,40 +31891,56 @@ func (c *TargetPoolsDeleteCall) Do() (*Operation, error) { // method id "compute.targetPools.get": type TargetPoolsGetCall struct { - s *Service - project string - region string - targetPool string - opt_ map[string]interface{} + s *Service + project string + region string + targetPool string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified TargetPool resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/get func (r *TargetPoolsService) Get(project string, region string, targetPool string) *TargetPoolsGetCall { - c := &TargetPoolsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsGetCall) Fields(s ...googleapi.Field) *TargetPoolsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsGetCall) IfNoneMatch(entityTag string) *TargetPoolsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsGetCall) Context(ctx context.Context) *TargetPoolsGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16473,7 +31948,33 @@ func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { "targetPool": c.targetPool, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.get" call. +// Exactly one of *TargetPool or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetPool.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16481,7 +31982,12 @@ func (c *TargetPoolsGetCall) Do() (*TargetPool, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetPool + ret := &TargetPool{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16539,14 +32045,15 @@ type TargetPoolsGetHealthCall struct { region string targetPool string instancereference *InstanceReference - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // GetHealth: Gets the most recent health check results for each IP for // the given instance that is referenced by given TargetPool. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/getHealth func (r *TargetPoolsService) GetHealth(project string, region string, targetPool string, instancereference *InstanceReference) *TargetPoolsGetHealthCall { - c := &TargetPoolsGetHealthCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsGetHealthCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool @@ -16554,28 +32061,32 @@ func (r *TargetPoolsService) GetHealth(project string, region string, targetPool return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsGetHealthCall) Fields(s ...googleapi.Field) *TargetPoolsGetHealthCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsGetHealthCall) Context(ctx context.Context) *TargetPoolsGetHealthCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsGetHealthCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.instancereference) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/getHealth") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16584,7 +32095,30 @@ func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.getHealth" call. +// Exactly one of *TargetPoolInstanceHealth or error will be non-nil. +// Any non-2xx status code is an error. Response headers are in either +// *TargetPoolInstanceHealth.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16592,7 +32126,12 @@ func (c *TargetPoolsGetHealthCall) Do() (*TargetPoolInstanceHealth, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetPoolInstanceHealth + ret := &TargetPoolInstanceHealth{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16651,42 +32190,47 @@ type TargetPoolsInsertCall struct { project string region string targetpool *TargetPool - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a TargetPool resource in the specified project and // region using the data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/insert func (r *TargetPoolsService) Insert(project string, region string, targetpool *TargetPool) *TargetPoolsInsertCall { - c := &TargetPoolsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetpool = targetpool return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsInsertCall) Fields(s ...googleapi.Field) *TargetPoolsInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsInsertCall) Context(ctx context.Context) *TargetPoolsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpool) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16694,7 +32238,30 @@ func (c *TargetPoolsInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16702,7 +32269,12 @@ func (c *TargetPoolsInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16749,77 +32321,124 @@ func (c *TargetPoolsInsertCall) Do() (*Operation, error) { // method id "compute.targetPools.list": type TargetPoolsListCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of TargetPool resources available to the // specified project and region. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/list func (r *TargetPoolsService) List(project string, region string) *TargetPoolsListCall { - c := &TargetPoolsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *TargetPoolsListCall) Filter(filter string) *TargetPoolsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *TargetPoolsListCall) MaxResults(maxResults int64) *TargetPoolsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *TargetPoolsListCall) PageToken(pageToken string) *TargetPoolsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsListCall) Fields(s ...googleapi.Field) *TargetPoolsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetPoolsListCall) IfNoneMatch(entityTag string) *TargetPoolsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsListCall) Context(ctx context.Context) *TargetPoolsListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.list" call. +// Exactly one of *TargetPoolList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *TargetPoolList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16827,7 +32446,12 @@ func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetPoolList + ret := &TargetPoolList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -16842,7 +32466,7 @@ func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -16856,7 +32480,7 @@ func (c *TargetPoolsListCall) Do() (*TargetPoolList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -16896,13 +32520,14 @@ type TargetPoolsRemoveHealthCheckCall struct { region string targetPool string targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // RemoveHealthCheck: Removes health check URL from targetPool. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeHealthCheck func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, targetPool string, targetpoolsremovehealthcheckrequest *TargetPoolsRemoveHealthCheckRequest) *TargetPoolsRemoveHealthCheckCall { - c := &TargetPoolsRemoveHealthCheckCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsRemoveHealthCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool @@ -16910,28 +32535,32 @@ func (r *TargetPoolsService) RemoveHealthCheck(project string, region string, ta return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsRemoveHealthCheckCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveHealthCheckCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsRemoveHealthCheckCall) Context(ctx context.Context) *TargetPoolsRemoveHealthCheckCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsRemoveHealthCheckCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremovehealthcheckrequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -16940,7 +32569,30 @@ func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.removeHealthCheck" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -16948,7 +32600,12 @@ func (c *TargetPoolsRemoveHealthCheckCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17007,13 +32664,14 @@ type TargetPoolsRemoveInstanceCall struct { region string targetPool string targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // RemoveInstance: Removes instance URL from targetPool. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/removeInstance func (r *TargetPoolsService) RemoveInstance(project string, region string, targetPool string, targetpoolsremoveinstancerequest *TargetPoolsRemoveInstanceRequest) *TargetPoolsRemoveInstanceCall { - c := &TargetPoolsRemoveInstanceCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsRemoveInstanceCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool @@ -17021,28 +32679,32 @@ func (r *TargetPoolsService) RemoveInstance(project string, region string, targe return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsRemoveInstanceCall) Fields(s ...googleapi.Field) *TargetPoolsRemoveInstanceCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsRemoveInstanceCall) Context(ctx context.Context) *TargetPoolsRemoveInstanceCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsRemoveInstanceCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetpoolsremoveinstancerequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/removeInstance") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -17051,7 +32713,30 @@ func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.removeInstance" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17059,7 +32744,12 @@ func (c *TargetPoolsRemoveInstanceCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17118,13 +32808,14 @@ type TargetPoolsSetBackupCall struct { region string targetPool string targetreference *TargetReference - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // SetBackup: Changes backup pool configurations. // For details, see https://cloud.google.com/compute/docs/reference/latest/targetPools/setBackup func (r *TargetPoolsService) SetBackup(project string, region string, targetPool string, targetreference *TargetReference) *TargetPoolsSetBackupCall { - c := &TargetPoolsSetBackupCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetPoolsSetBackupCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetPool = targetPool @@ -17135,35 +32826,36 @@ func (r *TargetPoolsService) SetBackup(project string, region string, targetPool // FailoverRatio sets the optional parameter "failoverRatio": New // failoverRatio value for the containing target pool. func (c *TargetPoolsSetBackupCall) FailoverRatio(failoverRatio float64) *TargetPoolsSetBackupCall { - c.opt_["failoverRatio"] = failoverRatio + c.urlParams_.Set("failoverRatio", fmt.Sprint(failoverRatio)) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetPoolsSetBackupCall) Fields(s ...googleapi.Field) *TargetPoolsSetBackupCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetPoolsSetBackupCall) Context(ctx context.Context) *TargetPoolsSetBackupCall { + c.ctx_ = ctx + return c +} + +func (c *TargetPoolsSetBackupCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetreference) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["failoverRatio"]; ok { - params.Set("failoverRatio", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetPools/{targetPool}/setBackup") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -17172,7 +32864,30 @@ func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetPools.setBackup" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetPoolsSetBackupCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17180,7 +32895,12 @@ func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17241,73 +32961,120 @@ func (c *TargetPoolsSetBackupCall) Do() (*Operation, error) { // method id "compute.targetVpnGateways.aggregatedList": type TargetVpnGatewaysAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of target VPN gateways grouped by // scope. func (r *TargetVpnGatewaysService) AggregatedList(project string) *TargetVpnGatewaysAggregatedListCall { - c := &TargetVpnGatewaysAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetVpnGatewaysAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *TargetVpnGatewaysAggregatedListCall) Filter(filter string) *TargetVpnGatewaysAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *TargetVpnGatewaysAggregatedListCall) MaxResults(maxResults int64) *TargetVpnGatewaysAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *TargetVpnGatewaysAggregatedListCall) PageToken(pageToken string) *TargetVpnGatewaysAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetVpnGatewaysAggregatedListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysAggregatedListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetVpnGatewaysAggregatedListCall) Context(ctx context.Context) *TargetVpnGatewaysAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/targetVpnGateways") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.aggregatedList" call. +// Exactly one of *TargetVpnGatewayAggregatedList or error will be +// non-nil. Any non-2xx status code is an error. Response headers are in +// either *TargetVpnGatewayAggregatedList.ServerResponse.Header or (if a +// response was returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17315,7 +33082,12 @@ func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedL if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetVpnGatewayAggregatedList + ret := &TargetVpnGatewayAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17329,7 +33101,7 @@ func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedL // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -17343,7 +33115,7 @@ func (c *TargetVpnGatewaysAggregatedListCall) Do() (*TargetVpnGatewayAggregatedL // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -17375,35 +33147,40 @@ type TargetVpnGatewaysDeleteCall struct { project string region string targetVpnGateway string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified TargetVpnGateway resource. func (r *TargetVpnGatewaysService) Delete(project string, region string, targetVpnGateway string) *TargetVpnGatewaysDeleteCall { - c := &TargetVpnGatewaysDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetVpnGatewaysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetVpnGateway = targetVpnGateway return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetVpnGatewaysDeleteCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetVpnGatewaysDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetVpnGatewaysDeleteCall) Context(ctx context.Context) *TargetVpnGatewaysDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -17411,7 +33188,30 @@ func (c *TargetVpnGatewaysDeleteCall) Do() (*Operation, error) { "targetVpnGateway": c.targetVpnGateway, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetVpnGatewaysDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17419,7 +33219,12 @@ func (c *TargetVpnGatewaysDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17475,35 +33280,51 @@ type TargetVpnGatewaysGetCall struct { project string region string targetVpnGateway string - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified TargetVpnGateway resource. func (r *TargetVpnGatewaysService) Get(project string, region string, targetVpnGateway string) *TargetVpnGatewaysGetCall { - c := &TargetVpnGatewaysGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetVpnGatewaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetVpnGateway = targetVpnGateway return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetVpnGatewaysGetCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetVpnGatewaysGetCall) Do() (*TargetVpnGateway, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysGetCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetVpnGatewaysGetCall) Context(ctx context.Context) *TargetVpnGatewaysGetCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -17511,7 +33332,33 @@ func (c *TargetVpnGatewaysGetCall) Do() (*TargetVpnGateway, error) { "targetVpnGateway": c.targetVpnGateway, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.get" call. +// Exactly one of *TargetVpnGateway or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetVpnGateway.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysGetCall) Do() (*TargetVpnGateway, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17519,7 +33366,12 @@ func (c *TargetVpnGatewaysGetCall) Do() (*TargetVpnGateway, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetVpnGateway + ret := &TargetVpnGateway{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17576,41 +33428,46 @@ type TargetVpnGatewaysInsertCall struct { project string region string targetvpngateway *TargetVpnGateway - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a TargetVpnGateway resource in the specified project // and region using the data included in the request. func (r *TargetVpnGatewaysService) Insert(project string, region string, targetvpngateway *TargetVpnGateway) *TargetVpnGatewaysInsertCall { - c := &TargetVpnGatewaysInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetVpnGatewaysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.targetvpngateway = targetvpngateway return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetVpnGatewaysInsertCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetVpnGatewaysInsertCall) Context(ctx context.Context) *TargetVpnGatewaysInsertCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetvpngateway) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -17618,7 +33475,30 @@ func (c *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17626,7 +33506,12 @@ func (c *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17673,76 +33558,123 @@ func (c *TargetVpnGatewaysInsertCall) Do() (*Operation, error) { // method id "compute.targetVpnGateways.list": type TargetVpnGatewaysListCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of TargetVpnGateway resources available to // the specified project and region. func (r *TargetVpnGatewaysService) List(project string, region string) *TargetVpnGatewaysListCall { - c := &TargetVpnGatewaysListCall{s: r.s, opt_: make(map[string]interface{})} + c := &TargetVpnGatewaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *TargetVpnGatewaysListCall) Filter(filter string) *TargetVpnGatewaysListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *TargetVpnGatewaysListCall) MaxResults(maxResults int64) *TargetVpnGatewaysListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *TargetVpnGatewaysListCall) PageToken(pageToken string) *TargetVpnGatewaysListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *TargetVpnGatewaysListCall) Fields(s ...googleapi.Field) *TargetVpnGatewaysListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *TargetVpnGatewaysListCall) IfNoneMatch(entityTag string) *TargetVpnGatewaysListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *TargetVpnGatewaysListCall) Context(ctx context.Context) *TargetVpnGatewaysListCall { + c.ctx_ = ctx + return c +} + +func (c *TargetVpnGatewaysListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/targetVpnGateways") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.targetVpnGateways.list" call. +// Exactly one of *TargetVpnGatewayList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *TargetVpnGatewayList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17750,7 +33682,12 @@ func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *TargetVpnGatewayList + ret := &TargetVpnGatewayList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17765,7 +33702,7 @@ func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -17779,7 +33716,7 @@ func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -17814,45 +33751,73 @@ func (c *TargetVpnGatewaysListCall) Do() (*TargetVpnGatewayList, error) { // method id "compute.urlMaps.delete": type UrlMapsDeleteCall struct { - s *Service - project string - urlMap string - opt_ map[string]interface{} + s *Service + project string + urlMap string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified UrlMap resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/delete func (r *UrlMapsService) Delete(project string, urlMap string) *UrlMapsDeleteCall { - c := &UrlMapsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.urlMap = urlMap return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsDeleteCall) Fields(s ...googleapi.Field) *UrlMapsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsDeleteCall) Context(ctx context.Context) *UrlMapsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "urlMap": c.urlMap, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *UrlMapsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17860,7 +33825,12 @@ func (c *UrlMapsDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17904,45 +33874,87 @@ func (c *UrlMapsDeleteCall) Do() (*Operation, error) { // method id "compute.urlMaps.get": type UrlMapsGetCall struct { - s *Service - project string - urlMap string - opt_ map[string]interface{} + s *Service + project string + urlMap string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified UrlMap resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/get func (r *UrlMapsService) Get(project string, urlMap string) *UrlMapsGetCall { - c := &UrlMapsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.urlMap = urlMap return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsGetCall) Fields(s ...googleapi.Field) *UrlMapsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsGetCall) Do() (*UrlMap, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlMapsGetCall) IfNoneMatch(entityTag string) *UrlMapsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsGetCall) Context(ctx context.Context) *UrlMapsGetCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "urlMap": c.urlMap, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.get" call. +// Exactly one of *UrlMap or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *UrlMap.ServerResponse.Header or (if a response was returned at all) +// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified +// was returned. +func (c *UrlMapsGetCall) Do() (*UrlMap, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -17950,7 +33962,12 @@ func (c *UrlMapsGetCall) Do() (*UrlMap, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *UrlMap + ret := &UrlMap{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -17995,51 +34012,79 @@ func (c *UrlMapsGetCall) Do() (*UrlMap, error) { // method id "compute.urlMaps.insert": type UrlMapsInsertCall struct { - s *Service - project string - urlmap *UrlMap - opt_ map[string]interface{} + s *Service + project string + urlmap *UrlMap + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a UrlMap resource in the specified project using the // data included in the request. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/insert func (r *UrlMapsService) Insert(project string, urlmap *UrlMap) *UrlMapsInsertCall { - c := &UrlMapsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.urlmap = urlmap return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsInsertCall) Fields(s ...googleapi.Field) *UrlMapsInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsInsertCall) Context(ctx context.Context) *UrlMapsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *UrlMapsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18047,7 +34092,12 @@ func (c *UrlMapsInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18086,74 +34136,121 @@ func (c *UrlMapsInsertCall) Do() (*Operation, error) { // method id "compute.urlMaps.list": type UrlMapsListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of UrlMap resources available to the // specified project. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/list func (r *UrlMapsService) List(project string) *UrlMapsListCall { - c := &UrlMapsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *UrlMapsListCall) Filter(filter string) *UrlMapsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *UrlMapsListCall) MaxResults(maxResults int64) *UrlMapsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *UrlMapsListCall) PageToken(pageToken string) *UrlMapsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsListCall) Fields(s ...googleapi.Field) *UrlMapsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsListCall) Do() (*UrlMapList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *UrlMapsListCall) IfNoneMatch(entityTag string) *UrlMapsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsListCall) Context(ctx context.Context) *UrlMapsListCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.list" call. +// Exactly one of *UrlMapList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *UrlMapList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *UrlMapsListCall) Do() (*UrlMapList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18161,7 +34258,12 @@ func (c *UrlMapsListCall) Do() (*UrlMapList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *UrlMapList + ret := &UrlMapList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18175,7 +34277,7 @@ func (c *UrlMapsListCall) Do() (*UrlMapList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -18189,7 +34291,7 @@ func (c *UrlMapsListCall) Do() (*UrlMapList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -18217,46 +34319,51 @@ func (c *UrlMapsListCall) Do() (*UrlMapList, error) { // method id "compute.urlMaps.patch": type UrlMapsPatchCall struct { - s *Service - project string - urlMap string - urlmap *UrlMap - opt_ map[string]interface{} + s *Service + project string + urlMap string + urlmap *UrlMap + urlParams_ gensupport.URLParams + ctx_ context.Context } // Patch: Update the entire content of the UrlMap resource. This method // supports patch semantics. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/patch func (r *UrlMapsService) Patch(project string, urlMap string, urlmap *UrlMap) *UrlMapsPatchCall { - c := &UrlMapsPatchCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.urlMap = urlMap c.urlmap = urlmap return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsPatchCall) Fields(s ...googleapi.Field) *UrlMapsPatchCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsPatchCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsPatchCall) Context(ctx context.Context) *UrlMapsPatchCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsPatchCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PATCH", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -18264,7 +34371,30 @@ func (c *UrlMapsPatchCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.patch" call. +// Exactly one of *Operation or error will be non-nil. 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 *UrlMapsPatchCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18272,7 +34402,12 @@ func (c *UrlMapsPatchCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18319,45 +34454,50 @@ func (c *UrlMapsPatchCall) Do() (*Operation, error) { // method id "compute.urlMaps.update": type UrlMapsUpdateCall struct { - s *Service - project string - urlMap string - urlmap *UrlMap - opt_ map[string]interface{} + s *Service + project string + urlMap string + urlmap *UrlMap + urlParams_ gensupport.URLParams + ctx_ context.Context } // Update: Update the entire content of the UrlMap resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/update func (r *UrlMapsService) Update(project string, urlMap string, urlmap *UrlMap) *UrlMapsUpdateCall { - c := &UrlMapsUpdateCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.urlMap = urlMap c.urlmap = urlmap return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsUpdateCall) Fields(s ...googleapi.Field) *UrlMapsUpdateCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsUpdateCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsUpdateCall) Context(ctx context.Context) *UrlMapsUpdateCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsUpdateCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmap) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("PUT", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -18365,7 +34505,30 @@ func (c *UrlMapsUpdateCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.update" call. +// Exactly one of *Operation or error will be non-nil. 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 *UrlMapsUpdateCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18373,7 +34536,12 @@ func (c *UrlMapsUpdateCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18424,7 +34592,8 @@ type UrlMapsValidateCall struct { project string urlMap string urlmapsvalidaterequest *UrlMapsValidateRequest - opt_ map[string]interface{} + urlParams_ gensupport.URLParams + ctx_ context.Context } // Validate: Run static validation for the UrlMap. In particular, the @@ -18432,35 +34601,39 @@ type UrlMapsValidateCall struct { // NOT create the UrlMap. // For details, see https://cloud.google.com/compute/docs/reference/latest/urlMaps/validate func (r *UrlMapsService) Validate(project string, urlMap string, urlmapsvalidaterequest *UrlMapsValidateRequest) *UrlMapsValidateCall { - c := &UrlMapsValidateCall{s: r.s, opt_: make(map[string]interface{})} + c := &UrlMapsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.urlMap = urlMap c.urlmapsvalidaterequest = urlmapsvalidaterequest return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *UrlMapsValidateCall) Fields(s ...googleapi.Field) *UrlMapsValidateCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *UrlMapsValidateCall) Context(ctx context.Context) *UrlMapsValidateCall { + c.ctx_ = ctx + return c +} + +func (c *UrlMapsValidateCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.urlmapsvalidaterequest) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/urlMaps/{urlMap}/validate") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -18468,7 +34641,30 @@ func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.urlMaps.validate" call. +// Exactly one of *UrlMapsValidateResponse or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *UrlMapsValidateResponse.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18476,7 +34672,12 @@ func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *UrlMapsValidateResponse + ret := &UrlMapsValidateResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18523,72 +34724,119 @@ func (c *UrlMapsValidateCall) Do() (*UrlMapsValidateResponse, error) { // method id "compute.vpnTunnels.aggregatedList": type VpnTunnelsAggregatedListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // AggregatedList: Retrieves the list of VPN tunnels grouped by scope. func (r *VpnTunnelsService) AggregatedList(project string) *VpnTunnelsAggregatedListCall { - c := &VpnTunnelsAggregatedListCall{s: r.s, opt_: make(map[string]interface{})} + c := &VpnTunnelsAggregatedListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *VpnTunnelsAggregatedListCall) Filter(filter string) *VpnTunnelsAggregatedListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *VpnTunnelsAggregatedListCall) MaxResults(maxResults int64) *VpnTunnelsAggregatedListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *VpnTunnelsAggregatedListCall) PageToken(pageToken string) *VpnTunnelsAggregatedListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *VpnTunnelsAggregatedListCall) Fields(s ...googleapi.Field) *VpnTunnelsAggregatedListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsAggregatedListCall) IfNoneMatch(entityTag string) *VpnTunnelsAggregatedListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *VpnTunnelsAggregatedListCall) Context(ctx context.Context) *VpnTunnelsAggregatedListCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsAggregatedListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/aggregated/vpnTunnels") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.aggregatedList" call. +// Exactly one of *VpnTunnelAggregatedList or error will be non-nil. Any +// non-2xx status code is an error. Response headers are in either +// *VpnTunnelAggregatedList.ServerResponse.Header or (if a response was +// returned at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18596,7 +34844,12 @@ func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *VpnTunnelAggregatedList + ret := &VpnTunnelAggregatedList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18610,7 +34863,7 @@ func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -18624,7 +34877,7 @@ func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -18652,39 +34905,44 @@ func (c *VpnTunnelsAggregatedListCall) Do() (*VpnTunnelAggregatedList, error) { // method id "compute.vpnTunnels.delete": type VpnTunnelsDeleteCall struct { - s *Service - project string - region string - vpnTunnel string - opt_ map[string]interface{} + s *Service + project string + region string + vpnTunnel string + urlParams_ gensupport.URLParams + ctx_ context.Context } // Delete: Deletes the specified VpnTunnel resource. func (r *VpnTunnelsService) Delete(project string, region string, vpnTunnel string) *VpnTunnelsDeleteCall { - c := &VpnTunnelsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &VpnTunnelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.vpnTunnel = vpnTunnel return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *VpnTunnelsDeleteCall) Fields(s ...googleapi.Field) *VpnTunnelsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *VpnTunnelsDeleteCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *VpnTunnelsDeleteCall) Context(ctx context.Context) *VpnTunnelsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -18692,7 +34950,30 @@ func (c *VpnTunnelsDeleteCall) Do() (*Operation, error) { "vpnTunnel": c.vpnTunnel, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.delete" call. +// Exactly one of *Operation or error will be non-nil. 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 *VpnTunnelsDeleteCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18700,7 +34981,12 @@ func (c *VpnTunnelsDeleteCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18752,39 +35038,55 @@ func (c *VpnTunnelsDeleteCall) Do() (*Operation, error) { // method id "compute.vpnTunnels.get": type VpnTunnelsGetCall struct { - s *Service - project string - region string - vpnTunnel string - opt_ map[string]interface{} + s *Service + project string + region string + vpnTunnel string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified VpnTunnel resource. func (r *VpnTunnelsService) Get(project string, region string, vpnTunnel string) *VpnTunnelsGetCall { - c := &VpnTunnelsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &VpnTunnelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.vpnTunnel = vpnTunnel return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *VpnTunnelsGetCall) Fields(s ...googleapi.Field) *VpnTunnelsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsGetCall) IfNoneMatch(entityTag string) *VpnTunnelsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *VpnTunnelsGetCall) Context(ctx context.Context) *VpnTunnelsGetCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels/{vpnTunnel}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -18792,7 +35094,33 @@ func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { "vpnTunnel": c.vpnTunnel, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.get" call. +// Exactly one of *VpnTunnel or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VpnTunnel.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18800,7 +35128,12 @@ func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *VpnTunnel + ret := &VpnTunnel{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18853,45 +35186,50 @@ func (c *VpnTunnelsGetCall) Do() (*VpnTunnel, error) { // method id "compute.vpnTunnels.insert": type VpnTunnelsInsertCall struct { - s *Service - project string - region string - vpntunnel *VpnTunnel - opt_ map[string]interface{} + s *Service + project string + region string + vpntunnel *VpnTunnel + urlParams_ gensupport.URLParams + ctx_ context.Context } // Insert: Creates a VpnTunnel resource in the specified project and // region using the data included in the request. func (r *VpnTunnelsService) Insert(project string, region string, vpntunnel *VpnTunnel) *VpnTunnelsInsertCall { - c := &VpnTunnelsInsertCall{s: r.s, opt_: make(map[string]interface{})} + c := &VpnTunnelsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region c.vpntunnel = vpntunnel return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *VpnTunnelsInsertCall) Fields(s ...googleapi.Field) *VpnTunnelsInsertCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *VpnTunnelsInsertCall) Do() (*Operation, error) { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *VpnTunnelsInsertCall) Context(ctx context.Context) *VpnTunnelsInsertCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsInsertCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.vpntunnel) if err != nil { return nil, err } ctype := "application/json" - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("POST", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -18899,7 +35237,30 @@ func (c *VpnTunnelsInsertCall) Do() (*Operation, error) { }) req.Header.Set("Content-Type", ctype) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.insert" call. +// Exactly one of *Operation or error will be non-nil. 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 *VpnTunnelsInsertCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -18907,7 +35268,12 @@ func (c *VpnTunnelsInsertCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -18954,76 +35320,123 @@ func (c *VpnTunnelsInsertCall) Do() (*Operation, error) { // method id "compute.vpnTunnels.list": type VpnTunnelsListCall struct { - s *Service - project string - region string - opt_ map[string]interface{} + s *Service + project string + region string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of VpnTunnel resources contained in the // specified project and region. func (r *VpnTunnelsService) List(project string, region string) *VpnTunnelsListCall { - c := &VpnTunnelsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &VpnTunnelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.region = region return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *VpnTunnelsListCall) Filter(filter string) *VpnTunnelsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *VpnTunnelsListCall) MaxResults(maxResults int64) *VpnTunnelsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *VpnTunnelsListCall) PageToken(pageToken string) *VpnTunnelsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *VpnTunnelsListCall) Fields(s ...googleapi.Field) *VpnTunnelsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *VpnTunnelsListCall) IfNoneMatch(entityTag string) *VpnTunnelsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *VpnTunnelsListCall) Context(ctx context.Context) *VpnTunnelsListCall { + c.ctx_ = ctx + return c +} + +func (c *VpnTunnelsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/regions/{region}/vpnTunnels") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "region": c.region, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.vpnTunnels.list" call. +// Exactly one of *VpnTunnelList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *VpnTunnelList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -19031,7 +35444,12 @@ func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *VpnTunnelList + ret := &VpnTunnelList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -19046,7 +35464,7 @@ func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -19060,7 +35478,7 @@ func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -19095,40 +35513,45 @@ func (c *VpnTunnelsListCall) Do() (*VpnTunnelList, error) { // method id "compute.zoneOperations.delete": type ZoneOperationsDeleteCall struct { - s *Service - project string - zone string - operation string - opt_ map[string]interface{} + s *Service + project string + zone string + operation string + urlParams_ gensupport.URLParams + ctx_ context.Context } -// Delete: Deletes the specified zone-specific operation resource. +// Delete: Deletes the specified zone-specific Operations resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/delete func (r *ZoneOperationsService) Delete(project string, zone string, operation string) *ZoneOperationsDeleteCall { - c := &ZoneOperationsDeleteCall{s: r.s, opt_: make(map[string]interface{})} + c := &ZoneOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.operation = operation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ZoneOperationsDeleteCall) Fields(s ...googleapi.Field) *ZoneOperationsDeleteCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ZoneOperationsDeleteCall) Do() error { +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ZoneOperationsDeleteCall) Context(ctx context.Context) *ZoneOperationsDeleteCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("DELETE", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -19136,7 +35559,15 @@ func (c *ZoneOperationsDeleteCall) Do() error { "operation": c.operation, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.delete" call. +func (c *ZoneOperationsDeleteCall) Do() error { + res, err := c.doRequest("json") if err != nil { return err } @@ -19146,7 +35577,7 @@ func (c *ZoneOperationsDeleteCall) Do() error { } return nil // { - // "description": "Deletes the specified zone-specific operation resource.", + // "description": "Deletes the specified zone-specific Operations resource.", // "httpMethod": "DELETE", // "id": "compute.zoneOperations.delete", // "parameterOrder": [ @@ -19156,7 +35587,7 @@ func (c *ZoneOperationsDeleteCall) Do() error { // ], // "parameters": { // "operation": { - // "description": "Name of the operation resource to delete.", + // "description": "Name of the Operations resource to delete.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -19189,40 +35620,56 @@ func (c *ZoneOperationsDeleteCall) Do() error { // method id "compute.zoneOperations.get": type ZoneOperationsGetCall struct { - s *Service - project string - zone string - operation string - opt_ map[string]interface{} + s *Service + project string + zone string + operation string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// Get: Retrieves the specified zone-specific operation resource. +// Get: Retrieves the specified zone-specific Operations resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/get func (r *ZoneOperationsService) Get(project string, zone string, operation string) *ZoneOperationsGetCall { - c := &ZoneOperationsGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &ZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone c.operation = operation return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ZoneOperationsGetCall) Fields(s ...googleapi.Field) *ZoneOperationsGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ZoneOperationsGetCall) Do() (*Operation, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsGetCall) IfNoneMatch(entityTag string) *ZoneOperationsGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ZoneOperationsGetCall) Context(ctx context.Context) *ZoneOperationsGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations/{operation}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, @@ -19230,7 +35677,33 @@ func (c *ZoneOperationsGetCall) Do() (*Operation, error) { "operation": c.operation, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.get" call. +// Exactly one of *Operation or error will be non-nil. 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 *ZoneOperationsGetCall) Do() (*Operation, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -19238,13 +35711,18 @@ func (c *ZoneOperationsGetCall) Do() (*Operation, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Operation + ret := &Operation{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the specified zone-specific operation resource.", + // "description": "Retrieves the specified zone-specific Operations resource.", // "httpMethod": "GET", // "id": "compute.zoneOperations.get", // "parameterOrder": [ @@ -19254,7 +35732,7 @@ func (c *ZoneOperationsGetCall) Do() (*Operation, error) { // ], // "parameters": { // "operation": { - // "description": "Name of the operation resource to return.", + // "description": "Name of the Operations resource to return.", // "location": "path", // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", // "required": true, @@ -19291,77 +35769,124 @@ func (c *ZoneOperationsGetCall) Do() (*Operation, error) { // method id "compute.zoneOperations.list": type ZoneOperationsListCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } -// List: Retrieves the list of operation resources contained within the +// List: Retrieves the list of Operation resources contained within the // specified zone. // For details, see https://cloud.google.com/compute/docs/reference/latest/zoneOperations/list func (r *ZoneOperationsService) List(project string, zone string) *ZoneOperationsListCall { - c := &ZoneOperationsListCall{s: r.s, opt_: make(map[string]interface{})} + c := &ZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *ZoneOperationsListCall) Filter(filter string) *ZoneOperationsListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *ZoneOperationsListCall) MaxResults(maxResults int64) *ZoneOperationsListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *ZoneOperationsListCall) PageToken(pageToken string) *ZoneOperationsListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ZoneOperationsListCall) Fields(s ...googleapi.Field) *ZoneOperationsListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ZoneOperationsListCall) Do() (*OperationList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZoneOperationsListCall) IfNoneMatch(entityTag string) *ZoneOperationsListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ZoneOperationsListCall) Context(ctx context.Context) *ZoneOperationsListCall { + c.ctx_ = ctx + return c +} + +func (c *ZoneOperationsListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}/operations") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zoneOperations.list" call. +// Exactly one of *OperationList or error will be non-nil. Any non-2xx +// status code is an error. Response headers are in either +// *OperationList.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use +// googleapi.IsNotModified to check whether the returned error was +// because http.StatusNotModified was returned. +func (c *ZoneOperationsListCall) Do() (*OperationList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -19369,13 +35894,18 @@ func (c *ZoneOperationsListCall) Do() (*OperationList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *OperationList + ret := &OperationList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } return ret, nil // { - // "description": "Retrieves the list of operation resources contained within the specified zone.", + // "description": "Retrieves the list of Operation resources contained within the specified zone.", // "httpMethod": "GET", // "id": "compute.zoneOperations.list", // "parameterOrder": [ @@ -19384,7 +35914,7 @@ func (c *ZoneOperationsListCall) Do() (*OperationList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -19398,7 +35928,7 @@ func (c *ZoneOperationsListCall) Do() (*OperationList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, @@ -19433,45 +35963,87 @@ func (c *ZoneOperationsListCall) Do() (*OperationList, error) { // method id "compute.zones.get": type ZonesGetCall struct { - s *Service - project string - zone string - opt_ map[string]interface{} + s *Service + project string + zone string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // Get: Returns the specified zone resource. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/get func (r *ZonesService) Get(project string, zone string) *ZonesGetCall { - c := &ZonesGetCall{s: r.s, opt_: make(map[string]interface{})} + c := &ZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project c.zone = zone return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ZonesGetCall) Fields(s ...googleapi.Field) *ZonesGetCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ZonesGetCall) Do() (*Zone, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesGetCall) IfNoneMatch(entityTag string) *ZonesGetCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ZonesGetCall) Context(ctx context.Context) *ZonesGetCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesGetCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones/{zone}") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, "zone": c.zone, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zones.get" call. +// Exactly one of *Zone or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *Zone.ServerResponse.Header or (if a response was returned at all) in +// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check +// whether the returned error was because http.StatusNotModified was +// returned. +func (c *ZonesGetCall) Do() (*Zone, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -19479,7 +36051,12 @@ func (c *ZonesGetCall) Do() (*Zone, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *Zone + ret := &Zone{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -19524,74 +36101,121 @@ func (c *ZonesGetCall) Do() (*Zone, error) { // method id "compute.zones.list": type ZonesListCall struct { - s *Service - project string - opt_ map[string]interface{} + s *Service + project string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context } // List: Retrieves the list of zone resources available to the specified // project. // For details, see https://cloud.google.com/compute/docs/reference/latest/zones/list func (r *ZonesService) List(project string) *ZonesListCall { - c := &ZonesListCall{s: r.s, opt_: make(map[string]interface{})} + c := &ZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.project = project return c } -// Filter sets the optional parameter "filter": Filter expression for -// filtering listed resources. +// Filter sets the optional parameter "filter": Sets a filter expression +// for filtering listed resources, in the form filter={expression}. Your +// {expression} must be in the format: FIELD_NAME COMPARISON_STRING +// LITERAL_STRING. +// +// The FIELD_NAME is the name of the field you want to compare. Only +// atomic field types are supported (string, number, boolean). The +// COMPARISON_STRING must be either eq (equals) or ne (not equals). The +// LITERAL_STRING is the string value to filter to. The literal value +// must be valid for the type of field (string, number, boolean). For +// string fields, the literal value is interpreted as a regular +// expression using RE2 syntax. The literal value must match the entire +// field. +// +// For example, filter=name ne example-instance. func (c *ZonesListCall) Filter(filter string) *ZonesListCall { - c.opt_["filter"] = filter + c.urlParams_.Set("filter", filter) return c } // MaxResults sets the optional parameter "maxResults": Maximum count of // results to be returned. func (c *ZonesListCall) MaxResults(maxResults int64) *ZonesListCall { - c.opt_["maxResults"] = maxResults + c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) return c } -// PageToken sets the optional parameter "pageToken": Tag returned by a -// previous list request when that list was truncated to maxResults. -// Used to continue a previous list request. +// PageToken sets the optional parameter "pageToken": Specifies a page +// token to use. Use this parameter if you want to list the next page of +// results. Set pageToken to the nextPageToken returned by a previous +// list request. func (c *ZonesListCall) PageToken(pageToken string) *ZonesListCall { - c.opt_["pageToken"] = pageToken + c.urlParams_.Set("pageToken", pageToken) return c } -// Fields allows partial responses to be retrieved. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. func (c *ZonesListCall) Fields(s ...googleapi.Field) *ZonesListCall { - c.opt_["fields"] = googleapi.CombineFields(s) + c.urlParams_.Set("fields", googleapi.CombineFields(s)) return c } -func (c *ZonesListCall) Do() (*ZoneList, error) { +// IfNoneMatch sets the 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. Use googleapi.IsNotModified to check whether the response +// error from Do is the result of In-None-Match. +func (c *ZonesListCall) IfNoneMatch(entityTag string) *ZonesListCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. Any +// pending HTTP request will be aborted if the provided context is +// canceled. +func (c *ZonesListCall) Context(ctx context.Context) *ZonesListCall { + c.ctx_ = ctx + return c +} + +func (c *ZonesListCall) doRequest(alt string) (*http.Response, error) { var body io.Reader = nil - params := make(url.Values) - params.Set("alt", "json") - if v, ok := c.opt_["filter"]; ok { - params.Set("filter", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["maxResults"]; ok { - params.Set("maxResults", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["pageToken"]; ok { - params.Set("pageToken", fmt.Sprintf("%v", v)) - } - if v, ok := c.opt_["fields"]; ok { - params.Set("fields", fmt.Sprintf("%v", v)) - } + c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/zones") - urls += "?" + params.Encode() + urls += "?" + c.urlParams_.Encode() req, _ := http.NewRequest("GET", urls, body) googleapi.Expand(req.URL, map[string]string{ "project": c.project, }) req.Header.Set("User-Agent", c.s.userAgent()) - res, err := c.s.client.Do(req) + if c.ifNoneMatch_ != "" { + req.Header.Set("If-None-Match", c.ifNoneMatch_) + } + if c.ctx_ != nil { + return ctxhttp.Do(c.ctx_, c.s.client, req) + } + return c.s.client.Do(req) +} + +// Do executes the "compute.zones.list" call. +// Exactly one of *ZoneList or error will be non-nil. Any non-2xx status +// code is an error. Response headers are in either +// *ZoneList.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified +// to check whether the returned error was because +// http.StatusNotModified was returned. +func (c *ZonesListCall) Do() (*ZoneList, error) { + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + } + } if err != nil { return nil, err } @@ -19599,7 +36223,12 @@ func (c *ZonesListCall) Do() (*ZoneList, error) { if err := googleapi.CheckResponse(res); err != nil { return nil, err } - var ret *ZoneList + ret := &ZoneList{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { return nil, err } @@ -19613,7 +36242,7 @@ func (c *ZonesListCall) Do() (*ZoneList, error) { // ], // "parameters": { // "filter": { - // "description": "Filter expression for filtering listed resources.", + // "description": "Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING.\n\nThe FIELD_NAME is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The COMPARISON_STRING must be either eq (equals) or ne (not equals). The LITERAL_STRING is the string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field.\n\nFor example, filter=name ne example-instance.", // "location": "query", // "type": "string" // }, @@ -19627,7 +36256,7 @@ func (c *ZonesListCall) Do() (*ZoneList, error) { // "type": "integer" // }, // "pageToken": { - // "description": "Tag returned by a previous list request when that list was truncated to maxResults. Used to continue a previous list request.", + // "description": "Specifies a page token to use. Use this parameter if you want to list the next page of results. Set pageToken to the nextPageToken returned by a previous list request.", // "location": "query", // "type": "string" // }, diff --git a/vendor/google.golang.org/api/gensupport/json.go b/vendor/google.golang.org/api/gensupport/json.go new file mode 100644 index 0000000000..193def5938 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/json.go @@ -0,0 +1,177 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gensupport is an internal implementation detail used by code +// generated by the google-api-go-generator tool. +// +// This package may be modified at any time without regard for backwards +// compatibility. It should not be used directly by API users. +package gensupport + +import ( + "encoding/json" + "fmt" + "reflect" + "strings" +) + +// MarshalJSON returns a JSON encoding of schema containing only selected fields. +// A field is selected if: +// * it has a non-empty value, or +// * its field name is present in forceSendFields, and +// * it is not a nil pointer or nil interface. +// The JSON key for each selected field is taken from the field's json: struct tag. +func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) { + if len(forceSendFields) == 0 { + return json.Marshal(schema) + } + + mustInclude := make(map[string]struct{}) + for _, f := range forceSendFields { + mustInclude[f] = struct{}{} + } + + dataMap, err := schemaToMap(schema, mustInclude) + if err != nil { + return nil, err + } + return json.Marshal(dataMap) +} + +func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[string]interface{}, error) { + m := make(map[string]interface{}) + s := reflect.ValueOf(schema) + st := s.Type() + + for i := 0; i < s.NumField(); i++ { + jsonTag := st.Field(i).Tag.Get("json") + if jsonTag == "" { + continue + } + tag, err := parseJSONTag(jsonTag) + if err != nil { + return nil, err + } + if tag.ignore { + continue + } + + v := s.Field(i) + f := st.Field(i) + if !includeField(v, f, mustInclude) { + continue + } + + // nil maps are treated as empty maps. + if f.Type.Kind() == reflect.Map && v.IsNil() { + m[tag.apiName] = map[string]string{} + continue + } + + // nil slices are treated as empty slices. + if f.Type.Kind() == reflect.Slice && v.IsNil() { + m[tag.apiName] = []bool{} + continue + } + + if tag.stringFormat { + m[tag.apiName] = formatAsString(v, f.Type.Kind()) + } else { + m[tag.apiName] = v.Interface() + } + } + return m, nil +} + +// formatAsString returns a string representation of v, dereferencing it first if possible. +func formatAsString(v reflect.Value, kind reflect.Kind) string { + if kind == reflect.Ptr && !v.IsNil() { + v = v.Elem() + } + + return fmt.Sprintf("%v", v.Interface()) +} + +// jsonTag represents a restricted version of the struct tag format used by encoding/json. +// It is used to describe the JSON encoding of fields in a Schema struct. +type jsonTag struct { + apiName string + stringFormat bool + ignore bool +} + +// parseJSONTag parses a restricted version of the struct tag format used by encoding/json. +// The format of the tag must match that generated by the Schema.writeSchemaStruct method +// in the api generator. +func parseJSONTag(val string) (jsonTag, error) { + if val == "-" { + return jsonTag{ignore: true}, nil + } + + var tag jsonTag + + i := strings.Index(val, ",") + if i == -1 || val[:i] == "" { + return tag, fmt.Errorf("malformed json tag: %s", val) + } + + tag = jsonTag{ + apiName: val[:i], + } + + switch val[i+1:] { + case "omitempty": + case "omitempty,string": + tag.stringFormat = true + default: + return tag, fmt.Errorf("malformed json tag: %s", val) + } + + return tag, nil +} + +// Reports whether the struct field "f" with value "v" should be included in JSON output. +func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]struct{}) bool { + // The regular JSON encoding of a nil pointer is "null", which means "delete this field". + // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. + // However, many fields are not pointers, so there would be no way to delete these fields. + // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. + // Deletion will be handled by a separate mechanism. + if f.Type.Kind() == reflect.Ptr && v.IsNil() { + return false + } + + // The "any" type is represented as an interface{}. If this interface + // is nil, there is no reasonable representation to send. We ignore + // these fields, for the same reasons as given above for pointers. + if f.Type.Kind() == reflect.Interface && v.IsNil() { + return false + } + + _, ok := mustInclude[f.Name] + return ok || !isEmptyValue(v) +} + +// isEmptyValue reports whether v is the empty value for its type. This +// implementation is based on that of the encoding/json package, but its +// correctness does not depend on it being identical. What's important is that +// this function return false in situations where v should not be sent as part +// of a PATCH operation. +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} diff --git a/vendor/google.golang.org/api/gensupport/params.go b/vendor/google.golang.org/api/gensupport/params.go new file mode 100644 index 0000000000..dfad3f414d --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/params.go @@ -0,0 +1,31 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import "net/url" + +// URLParams is a simplified replacement for url.Values +// that safely builds up URL parameters for encoding. +type URLParams map[string][]string + +// Set sets the key to value. +// It replaces any existing values. +func (u URLParams) Set(key, value string) { + u[key] = []string{value} +} + +// SetMulti sets the key to an array of values. +// It replaces any existing values. +// Note that values must not be modified after calling SetMulti +// so the caller is responsible for making a copy if necessary. +func (u URLParams) SetMulti(key string, values []string) { + u[key] = values +} + +// Encode encodes the values into ``URL encoded'' form +// ("bar=baz&foo=quux") sorted by key. +func (u URLParams) Encode() string { + return url.Values(u).Encode() +} diff --git a/vendor/google.golang.org/api/googleapi/googleapi.go b/vendor/google.golang.org/api/googleapi/googleapi.go index 5fd2ef629f..bfd740f232 100644 --- a/vendor/google.golang.org/api/googleapi/googleapi.go +++ b/vendor/google.golang.org/api/googleapi/googleapi.go @@ -24,6 +24,7 @@ import ( "time" "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" "google.golang.org/api/googleapi/internal/uritemplates" ) @@ -42,6 +43,16 @@ type SizeReaderAt interface { Size() int64 } +// ServerResponse is embedded in each Do response and +// provides the HTTP status code and header sent by the server. +type ServerResponse struct { + // HTTPStatusCode is the server's response status code. + // When using a resource method's Do call, this will always be in the 2xx range. + HTTPStatusCode int + // Header contains the response header fields from the server. + Header http.Header +} + const ( Version = "0.5" @@ -65,6 +76,8 @@ type Error struct { // Body is the raw response returned by the server. // It is often but not always JSON, depending on how the request fails. Body string + // Header contains the response header fields from the server. + Header http.Header Errors []ErrorItem } @@ -122,6 +135,34 @@ func CheckResponse(res *http.Response) error { return jerr.Error } } + return &Error{ + Code: res.StatusCode, + Body: string(slurp), + Header: res.Header, + } +} + +// IsNotModified reports whether err is the result of the +// server replying with http.StatusNotModified. +// Such error values are sometimes returned by "Do" methods +// on calls when If-None-Match is used. +func IsNotModified(err error) bool { + if err == nil { + return false + } + ae, ok := err.(*Error) + return ok && ae.Code == http.StatusNotModified +} + +// CheckMediaResponse returns an error (of type *Error) if the response +// status code is not 2xx. Unlike CheckResponse it does not assume the +// body is a JSON error document. +func CheckMediaResponse(res *http.Response) error { + if res.StatusCode >= 200 && res.StatusCode <= 299 { + return nil + } + slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20)) + res.Body.Close() return &Error{ Code: res.StatusCode, Body: string(slurp), @@ -307,6 +348,7 @@ type ResumableUpload struct { mu sync.Mutex // guards progress progress int64 // number of bytes uploaded so far + started bool // whether the upload has been started // Callback is an optional function that will be called upon every progress update. Callback ProgressUpdater @@ -327,12 +369,12 @@ func (rx *ResumableUpload) Progress() int64 { return rx.progress } -func (rx *ResumableUpload) transferStatus() (int64, *http.Response, error) { +func (rx *ResumableUpload) transferStatus(ctx context.Context) (int64, *http.Response, error) { req, _ := http.NewRequest("POST", rx.URI, nil) req.ContentLength = 0 req.Header.Set("User-Agent", rx.UserAgent) req.Header.Set("Content-Range", fmt.Sprintf("bytes */%v", rx.ContentLength)) - res, err := rx.Client.Do(req) + res, err := ctxhttp.Do(ctx, rx.Client, req) if err != nil || res.StatusCode != statusResumeIncomplete { return 0, res, err } @@ -354,10 +396,16 @@ type chunk struct { } func (rx *ResumableUpload) transferChunks(ctx context.Context) (*http.Response, error) { - start, res, err := rx.transferStatus() - if err != nil || res.StatusCode != statusResumeIncomplete { - return res, err + var start int64 + var err error + res := &http.Response{} + if rx.started { + start, res, err = rx.transferStatus(ctx) + if err != nil || res.StatusCode != statusResumeIncomplete { + return res, err + } } + rx.started = true for { select { // Check for cancellation @@ -376,7 +424,7 @@ func (rx *ResumableUpload) transferChunks(ctx context.Context) (*http.Response, req.Header.Set("Content-Range", fmt.Sprintf("bytes %v-%v/%v", start, start+reqSize-1, rx.ContentLength)) req.Header.Set("Content-Type", rx.MediaType) req.Header.Set("User-Agent", rx.UserAgent) - res, err = rx.Client.Do(req) + res, err = ctxhttp.Do(ctx, rx.Client, req) start += reqSize if err == nil && (res.StatusCode == statusResumeIncomplete || res.StatusCode == http.StatusOK) { rx.mu.Lock() diff --git a/vendor/google.golang.org/api/googleapi/types.go b/vendor/google.golang.org/api/googleapi/types.go index 7ed7dd9823..a02b4b0716 100644 --- a/vendor/google.golang.org/api/googleapi/types.go +++ b/vendor/google.golang.org/api/googleapi/types.go @@ -148,3 +148,35 @@ func (s Float64s) MarshalJSON() ([]byte, error) { return strconv.AppendFloat(dst, s[i], 'g', -1, 64) }) } + +/* + * Helper routines for simplifying the creation of optional fields of basic type. + */ + +// Bool is a helper routine that allocates a new bool value +// to store v and returns a pointer to it. +func Bool(v bool) *bool { return &v } + +// Int32 is a helper routine that allocates a new int32 value +// to store v and returns a pointer to it. +func Int32(v int32) *int32 { return &v } + +// Int64 is a helper routine that allocates a new int64 value +// to store v and returns a pointer to it. +func Int64(v int64) *int64 { return &v } + +// Float64 is a helper routine that allocates a new float64 value +// to store v and returns a pointer to it. +func Float64(v float64) *float64 { return &v } + +// Uint32 is a helper routine that allocates a new uint32 value +// to store v and returns a pointer to it. +func Uint32(v uint32) *uint32 { return &v } + +// Uint64 is a helper routine that allocates a new uint64 value +// to store v and returns a pointer to it. +func Uint64(v uint64) *uint64 { return &v } + +// String is a helper routine that allocates a new string value +// to store v and returns a pointer to it. +func String(v string) *string { return &v }